Grouping and Functions
In presence of grouping, aggregate functions apply to each group individually.
- Output has one row per group
Order of processing:
- WHERE conditions,
- then GROUPING,
- then SELECT (including agg. functions).
But… what if you want a condition applied after the grouping??