Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
CUBE
Summary

Instruction

Great! As with ROLLUP, you can use the GROUPING() function with CUBE.

Exercise

Show the average damage repair cost for all possible combinations of year, month, and cause. Remove the row containing the total average from the results with the help of the GROUPING() function.

Show the following columns in the query result: year, month, cause, and avg_cost.

Stuck? Here's a hint!

Use:

GROUPING(year) + GROUPING(month) + GROUPING(cause) < 3