Instruction
Perfect! You can see that by reversing the order of the columns inside the ROLLUP's parentheses, we changed one of the groupings.
As a general rule, ROLLUP will always show new grouping combinations by removing columns one by one, starting from the right:
GROUP BY ROLLUP (A, B, C) = GROUP BY (A, B, C) + GROUP BY (A, B) + GROUP BY (A) + GROUP BY ()
Okay, it's your turn now!
Exercise
Show how much was spent in each category on each day, on each day in general, and in general among all days and categories. Show the following columns: category, delivery_date, and the sum of total_price (as total).
Stuck? Here's a hint!
Use:
GROUP BY ROLLUP(delivery_date, category)



