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

ROLLUP clause is also an abbreviation of the GROUPING SETS clause, but you use it when there’s a hierarchy formed by the input elements. In such a case, only a subset of the possible grouping sets is really interesting.


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


For instance, if a grouping set contains Country, State, City, it doesn't make sense to aggregate just City. Cities in different countries and states have the same name, but it is not an appropriate classification for grouping.