What is the `GROUPING()` function used for in SQL with ROLLUP or CUBE?

Advanced SQL Developer Medium

Advanced SQL Developer — Medium

What is the `GROUPING()` function used for in SQL with ROLLUP or CUBE?

Key points

  • `GROUPING()` helps differentiate aggregated columns in super-aggregate rows.
  • It assists in identifying grand total rows.
  • This function is specifically used with ROLLUP or CUBE operations.

Ready to go further?

Related questions