Calculating interest query

  • Chris Morris-439714 (11/1/2010)


    Paul White NZ (11/1/2010)


    Chris Morris-439714 (11/1/2010)


    Nah mate my walking-on-water skills are still underwhelming - don't even drink the stuff, fish f...never mind. Spill the beans! I'll try to understand, promise!

    SQLCLR, naturally - using Adam's Query Parallelizer πŸ™‚

    Ooh you cheat, that's not a fix that's a different method altogether πŸ˜‰

    How's that cheating?

    You never rewrote something from scratch to make it more efficient?

  • Ninja's_RGR'us (11/1/2010)


    Chris Morris-439714 (11/1/2010)


    Paul White NZ (11/1/2010)


    Chris Morris-439714 (11/1/2010)


    Nah mate my walking-on-water skills are still underwhelming - don't even drink the stuff, fish f...never mind. Spill the beans! I'll try to understand, promise!

    SQLCLR, naturally - using Adam's Query Parallelizer πŸ™‚

    Ooh you cheat, that's not a fix that's a different method altogether πŸ˜‰

    How's that cheating?

    You never rewrote something from scratch to make it more efficient?

    Y.

    β€œ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

  • Chris Morris-439714 (11/1/2010)


    Y.

    That's a pretty efficient answer right there!

  • Y

    Would have been much better, 50% space saved in the DB, and then remove the signature and you're off to the races! :w00t:

  • Sorry... posted to the wrong thread... post removed.

    --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)

  • Dear SQL Kiwi,

    Could you please explain little bit of your code, i mean what is happning behiend the scene (I am little week in T-SQL).

    Nice code by the way!!

    Thanks in advance

  • Re: Super Fast DISTINCT using CTEs - by Paul White

    Hi Paul,

    How can I extend your technique to multiple VARCHAR columns please?

    Any clues please?

    Thank you,

    Piyush

  • piyush.varma (7/23/2012)


    Re: Super Fast DISTINCT using CTEs - by Paul White

    Hi Paul,

    How can I extend the technique to multiple columns please?

    Any clues please?

    Thank you,

    Piyush

    It IS VERY fast indeed! But only if the number of distinct rows out number those that have duplicates. If you have a lot of duplicate rows, you may want to revert back to a simple DISTINCT or GROUP BY clause.

    --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 8 posts - 61 through 67 (of 67 total)

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