What is the difference between WHERE and HAVING?
Short answer
WHERE filters rows, HAVING filters groups.
Advertisement
AModel answer
WHERE filters rows, HAVING filters groups.
Example
Filter totals.
Real-world example
Using GROUP BY, an analyst calculated monthly revenue by region in seconds.
Likely follow-ups
- What are aggregate functions
- What is GROUP BY
- What is HAVING
Related topics