|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Saturday, January 19, 2013 8:28 AM
Points: 1,038,
Visits: 255
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, August 23, 2012 5:36 AM
Points: 10,
Visits: 29
|
|
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.
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 11:41 AM
Points: 77,
Visits: 218
|
|
| 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.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 4:05 AM
Points: 318,
Visits: 640
|
|
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, April 09, 2013 3:12 PM
Points: 2,
Visits: 12
|
|
Nice article! I had never really thought much about using those powerful options with GROUP BY, but now I will use them more.
--Bill
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, August 27, 2012 7:07 AM
Points: 1,
Visits: 4
|
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Monday, February 18, 2013 6:17 AM
Points: 674,
Visits: 472
|
|
Good article and clear explanation.
Had do refactor the INSERT statements as my organisation uses SQL 2005.
"Be brave. Take risks. Nothing can substitute experience."
|
|
|
|