Full Detailed Article for "Grouping Sets" is available at :
http://sqlserver-training.com/groupin...
Follow us at more Updates at
-----------------------------------------
Website : http://sqlserver-training.com/
Twitter : / dbatag
Facebook : / dbatag
Linked In : / dbatag
================================
You can use the GROUPING SETS extension of the GROUP BY clause to specify multiple groupings of data in one query. It generates the same result set that you would obtain by using the UNION ALL clause, but in a more efficient way. You can use GROUPING SETS to simplify complex aggregation queries into one query.
Visit the following link for more details and SQL Server Tutorials
http://sqlserver-training.com/groupin...