QuestionQ23

VerifiedReporting Aggregated Data Using the Group Functions

Review this partial query:

Question Image

Review this output:

Question Image

Which GROUP BY clause must be added for the query to return the results shown?

Explanation

ch.channel_type is retained at every aggregation level. ROLLUP(t.month, co.country_code) produces aggregates by channel type, month, and country; then the month subtotal within each channel type; then the channel-type total. This matches the rows in which CO is null for monthly subtotals and both MONTH and CO are null for each channel total. Oracle documents that ROLLUP produces superaggregate groupings in addition to regular groupings.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!