What SQL technique efficiently calculates subtotals and grand totals in a single query?

SQL Data Analyst Hard

SQL Data Analyst — Hard

What SQL technique efficiently calculates subtotals and grand totals in a single query?

Key points

  • ROLLUP adds subtotal and grand total rows
  • GROUP BY with ROLLUP is efficient for summary calculations
  • Provides a concise way to display total values

Ready to go further?

Related questions