O'Reilly logo
  • Dustin Waybright thinks this is interesting:

The output combines the results of grouping and aggregating the data of four different grouping sets. As you can see in the output, NULLs are used as placeholders in rows where an element isn’t part of the grouping set.


Cover of Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012


Could use the function if you wanted to create groups of sales by customer-by year, by customer overall, by year overall for example. For year overall, the customer number would be NULL. The NULL set returns the aggregate total for every potential member of the set.