How to create a minimal tally table and to describe its advantages (if any)

  • Steve Collins wrote:

    However, it appears the OP didn't go for it and just only wants his kludge to be made to work.

    Considering the way the OP asked the question, I'm not surprised at all.  It's also the way most OPs seem to be on SO and a part of the reason why I don't hang around there much.  You CAN lead a horse to water and you CAN make them drink but only by applying suction to the wrong end of the horse and I'm not going there. 😀

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Steve Collins wrote:

    That's not how long the SQL code takes to execute.  Tally based method would crush the OP's kludge especially as their test case is  spanning thousands of days.

    19 minutes is how long it took me to write the tally based code.  12 minutes is how long the first answer-er (GL) took.  So when I added my answer there was already the other answer.  It's annoying getting beaten to the first answer.

    You simply stated ...

    It took 19 minutes vs 12 minutes for the rCTE.

    ... with no indication at all that that's the amount of time it took to make responses.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 2 posts - 46 through 46 (of 46 total)

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