If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

SQL: Using HAVING with GROUP BY

When you use GROUP BY to group results in a SELECT query and also use an aggregate function, you can use HAVING to limit the results to only the rows where the grouped values match a certain condition.
▶️ You can also learn about this in our Restricting grouped results with HAVING talkthrough.

Want to join the conversation?

No posts yet.