GROUP BY and Aggregations
Core Aggregate Functions
SELECT
SUM(price) AS total_revenue,
COUNT(order_id) AS total_orders
FROM sales_table;The GROUP BY Clause
GROUP BY ClauseFiltering Aggregates with HAVING
HAVINGAggregating Unique Values (DISTINCT)
DISTINCT)Summary Reference Table
Last updated