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 AvgCost.

Stuck? Here's a hint!

Use:

GROUPING(Year) + GROUPING(Month) + GROUPING(Cause) < 3