What does GROUP BY ROLLUP(dept, role) produce compared to a plain GROUP BY?

SQL Data Analyst Medium

SQL Data Analyst — Medium

What does GROUP BY ROLLUP(dept, role) produce compared to a plain GROUP BY?

Key points

  • ROLLUP generates subtotals and grand totals
  • Provides detail-level aggregates
  • Simplifies analysis by combining multiple levels in one query

Ready to go further?

Related questions