The OVER Clause enhancements in SQL Server code named “Denali”, CTP3

  • Evil Kraig F (8/25/2011)


    Wayne,

    Excellent examples and a solid walkthrough, thank you.

    Btw, for your question about real-use of range, you'd have to wrap the results in a distinct.

    I'm thinking of log-entries. If you want by day-running totals, you'd do a by range and then distinct the results on the summed columns and the leading identifiers. This way if 2 ppl worked on a project 1 day and 10 people the next you could still have 2 rows, one identifying each day after the distinct with the correct totals.

    Ah! Great example - thanks!

  • I had no idea you could use PARTITION BY with things like MIN, MAX, COUNT, etc. :blush:

    Thank you for the article!

  • mishaluba (8/27/2011)


    I had no idea you could use PARTITION BY with things like MIN, MAX, COUNT, etc. :blush:

    Thank you for the article!

    You're welcome... and I'm glad you've learned from it!

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Nice article, Wayne!

    And I also liked your post on the performance comparison on your blog.

    Cool stuff. Thank you.

    -- Gianluca Sartori

  • Gianluca, I'm glad that you liked both the article and the blog. Thanks!

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

Viewing 5 posts - 31 through 34 (of 34 total)

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