What does the `CUBE` modifier in `GROUP BY` generate?

Advanced SQL Developer Medium

Advanced SQL Developer — Medium

What does the `CUBE` modifier in `GROUP BY` generate?

Key points

  • `CUBE` generates subtotals for all specified dimensions
  • It creates multiple grouping sets, including the grand total
  • The number of grouping sets is determined by 2^n for n columns

Ready to go further?

Related questions