A data analyst processes a complex aggregation on a table containing zero null values, and the query returns the following result:
Which query did the analyst run to produce this result?
GROUP BY group_1, group_2 WITH ROLLUP adds hierarchical super-aggregate rows: a subtotal for each group_1 value with group_2 shown as NULL, followed by a grand-total row with both grouping columns shown as NULL. These are rollup markers rather than NULL values from the source table. A CUBE would additionally return totals for each group_2 value across all group_1 values.
GROUP BY group_1, group_2 WITH ROLLUP
group_1
group_2
NULL
CUBE
Community Discussion