January 10, 2012 at 9:55 am
Comments posted to this topic are about the item Stairway to T-SQL DML Level 8: Using the ROLLUP, CUBE and GROUPING SET operator in a GROUP BY Clause
Gregory A. Larsen, MVP
August 21, 2012 at 11:39 pm
Greg Larsen (1/10/2012)
Comments posted to this topic are about the item <A HREF="/articles/Stairway+Series/87629/">Stairway to T-SQL DML Level 8: Using the ROLLUP, CUBE and GROUPING SET operator in a GROUP BY Clause</A>
It is an amazing article on the Rollup, Cube and Grouping SEt operators. Excelling explanation and very good presentation with very simple example.
August 22, 2012 at 12:39 am
Good article, but I've been surprised with the use of COALESCE() for getting the 'Grand Total' in Listing 3. I think it's better to use the GROUPING() function to know if we are dealing with a subtotal row, and then replace the NULL with the correct label. If you use COALESCE() and there is some NULL value in the column CheckFor, you'll get a mistaken label.
August 22, 2012 at 1:41 am
Thanks for this, it's a good clear summary of these features.
Are there any performance gains to be had by switching to use these features over unioning a set of SQL statements together? If so I have a few reports that might benefit from rewriting to use them.
Barney
August 22, 2012 at 9:23 am
Nice article! I had never really thought much about using those powerful options with GROUP BY, but now I will use them more.
--Bill
August 22, 2012 at 2:18 pm
test
August 23, 2012 at 1:57 am
Good article and clear explanation.
Had do refactor the INSERT statements as my organisation uses SQL 2005.
:exclamation: "Be brave. Take risks. Nothing can substitute experience." :exclamation:
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply