This post discusses three lesser-known grouping operations in SQL: Grouping Sets, Rollup, and Cube. These operations allow for efficient multiple aggregations on the same table, generating subtotals, grand totals, and all possible combinations of aggregations. The order is important in ROLLUP, and CUBE creates a result set with all possible combinations.
Sort: