Stairway to T-SQL DML Level 8: Using the ROLLUP, CUBE and GROUPING SET operator in a GROUP BY Clause

Posted on SQL Server Central See other posts from SQL Server Central
Published on Wed, 22 Aug 2012 06:00:00 UT Indexed on 2012/08/28 9:46 UTC
Read the original article Hit count: 196

Filed under:

In this article I will be expanding on my discussion of the GROUP BY clause by exploring the ROLLUP, CUBE and GROUPING SETS operators. These additional GROUP BY operators make it is easy to have SQL Server create subtotals, grand totals, a superset of subtotals, as well as multiple aggregate groupings in a single SELECT statement.

SQL Source Control Local evaluation repository makes trying SQL Source Control simple
The evaluation repository makes it easy to try SQL Source Control. Get started with the 28-day free trial.

© SQL Server Central or respective owner