What does HAVING do?
Model answer
It filters groups after GROUP BY, using aggregates: SELECT dept, AVG(salary) FROM employees GROUP BY dept HAVING AVG(salary) > 50000.
Learn this topic
GROUP BY and HAVING: Summaries for Each Group in the course SQL for Beginners: Learn Databases Step by Step.
Sign in to add your own answer.
More questions
- What are aggregate functions?
- What is the difference between COUNT(*), COUNT(column) and COUNT(DISTINCT column)?
- What does GROUP BY do?
- How do you find duplicate values in a column?
- How do you count rows per category including categories with zero rows?
- How do you calculate a running total or percentage of total?