August 26, 2011 at 9:31 am
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!
August 27, 2011 at 9:46 pm
I had no idea you could use PARTITION BY with things like MIN, MAX, COUNT, etc. :blush:
Thank you for the article!
August 28, 2011 at 8:01 am
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
August 30, 2011 at 5:45 am
Nice article, Wayne!
And I also liked your post on the performance comparison on your blog.
Cool stuff. Thank you.
-- Gianluca Sartori
August 30, 2011 at 7:09 pm
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
Viewing 5 posts - 31 through 34 (of 34 total)
You must be logged in to reply to this topic. Login to reply