Part 55: Multi-Column Grouping & Aggregation Hierarchies
Grouping by multiple columns produces breakdown reports across subcategories.
1. Syntax
SELECT
country,
city,
COUNT(*) AS store_count,
SUM(total_sales) AS total_revenue
FROM stores
GROUP BY country, city
ORDER BY country, total_revenue DESC;
Key Takeaways
- Grouping across multiple columns reveals multi-dimensional data breakdowns.
In Part 56, we will explore Advanced Grouping: GROUPING SETS for Flexible Reporting!

