Forum Replies Created

Viewing 15 posts - 9,721 through 9,735 (of 10,144 total)

  • RE: Usage of "Tally Table"

    What's your point, Karthik? Chris knows exactly what the output will be for any pair of numbers entered into his query...

  • RE: Matching recoreds

    What are the three tables? How are they related?

  • RE: Can this be optimized?

    You're welcome Jo, thanks for the feedback.

  • RE: Can this be optimized?

    Hi Jo

    If this is a training exercise then you are going to learn loads about normalisation and database layout, at least until you throw your computer out of the window...

  • RE: Usage of "Tally Table"

    Chris, Karthik's corrected code has the same functionality but was it by design? 😛

  • RE: How to get Sequential ordering of data based on Ids Passed to IN Keyword

    How are you passing in your ID's?

    Here's a possibility:

    SELECT a.Col1

    FROM table1 a

    INNER JOIN (

    SELECT 1 AS RowID, 2 AS col_ID UNION ALL

    SELECT 2, 1 UNION ALL

    SELECT 3,...

  • RE: Can this be optimized?

    Hi Jo

    This is intended to replace your stored procedure. Please note that it's untested because I don't have your data, you should test the output against your sproc.

    SELECT VBR_ID, VDR_ID,...

  • RE: Can this be optimized?

    Hi Jo, yes it is, thanks.

    I'll use the view, and select from it to create the temp table with the calculations incorporated into it. Ideally you would query from...

  • RE: Usage of "Tally Table"

    karthikeyan (7/31/2008)


    I think if we change his code from

    select

    a.N as AccountNum

    ,b.N...

  • RE: Usage of "Tally Table"

    I see your point Karthik.

    Chris's code generates repeats of 100, yours generates repeats of 1000 (multipled by the row count in your tally table). Do you think it's possible...

  • RE: Can this be optimized?

    Hi Jo

    You could convert the cursor-based update of the temp table to a set-based update like this:

    UPDATE #TMP_VBR

    SET

    tempr1 = CASE WHEN tempr1 <> 0 THEN tempr1 + tempreti...

  • RE: Usage of "Tally Table"

    Test them, Karthik!

    The main difference that I can see is that Chris's version will always give 10,000 rows. The number of rows your version will give, will depend on how...

  • RE: JOINING OF TWO TABLES

    karthikeyan (7/30/2008)


    Create View v1

    as

    Select Eno,Ename from e1.dbo.emp

    where Eno = 5

    Union All

    Select Eno,Ename from e1.dbo.empmast

    where Eno = 5

    Now,

    Select Eno,Ename from v1

    Karthik, why not just join the two tables on Eno?...

  • RE: JOINING OF TWO TABLES

    VENUGOPAL.RR (7/30/2008)


    HI

    i have two tables with different number of rows and no identity columns in each one

    i want to join them and retrieve in single table

    please help me...

  • RE: UK Cultures

    James A. Lawrence (7/30/2008)


    And wanted to mention that I have the English to thank for oh so many hours-upon-hours of good music. The classic stuff of course like Rolling Stones,...

Viewing 15 posts - 9,721 through 9,735 (of 10,144 total)