Solution: Only Keep Interesting Groups
Explore filtering grouped data in SQL by using the HAVING clause to keep only interesting groups. Learn how to calculate averages per city and display results that meet specific aggregate conditions in your queries.
We'll cover the following...
We'll cover the following...
Query
SELECT city, AVG(age) AS avg_ageFROM peopleGROUP BY cityHAVING AVG(age) < 28;
...