Need help on TSQL

  • Interestingly, Bob's query, while undeniably compact, still scans the source table twice.

    You fail to ascertain that performance was not my primary design criterion. πŸ˜›

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • The Dixie Flatline (9/24/2010)


    Interestingly, Bob's query, while undeniably compact, still scans the source table twice.

    You fail to ascertain that performance was not my primary design criterion. πŸ˜›

    Bob, you could meet your design criteria more closely by putting a semicolon on the end of it.

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • The Dixie Flatline (9/24/2010)


    Interestingly, Bob's query, while undeniably compact, still scans the source table twice.

    You fail to ascertain that performance was not my primary design criterion. πŸ˜›

    I'm trying not to think about that.

  • Hey, Chris started it. πŸ˜€

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • Chris Morris-439714 (9/24/2010)


    The Dixie Flatline (9/24/2010)


    Interestingly, Bob's query, while undeniably compact, still scans the source table twice.

    You fail to ascertain that performance was not my primary design criterion. πŸ˜›

    Bob, you could meet your design criteria more closely by putting a semicolon on the end of it.

    I could always add comments.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • The Dixie Flatline (9/24/2010)


    Hey, Chris started it. πŸ˜€

    Ooh Bob you grass!

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Truth... I am so ashamed.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • Paul,

    I am sorry, I couldnt make it clear. I just need to find out the item which has different value. But, i don't want to touch the item which has only one value or same value multiple times.

    Thanks

    W.

Viewing 8 posts - 16 through 22 (of 22 total)

You must be logged in to reply to this topic. Login to reply