SQL 62 🛢️ Grouping Sets: ROLLUP, CUBE, and GROUPING SETS
A GROUP BY clause with a single set of columns produces one row per distinct combination of those columns. That is the standard aggregation behavior, and it answers a specific question: “what is the total for each group?” But analytical queries often need more than one answer at once. A report might need the total…