SQL Playground
TutorialsPlayground
SQL FormatterSQL MinifierSyntax ValidatorJSON to SQLCSV to SQLSQL to JSONER Diagram Generator
Daily ChallengeInterviewsCheat SheetBlog

© 2026 SQL Playground. Built for developers.

PrivacyTermsAboutRSS Feed
SQL Playground
TutorialsPlayground
SQL FormatterSQL MinifierSyntax ValidatorJSON to SQLCSV to SQLSQL to JSONER Diagram Generator
Daily ChallengeInterviewsCheat SheetBlog
Initializing...
Chapter 4: Aggregation
4-3
Your Progress

HAVING Clause

The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions.

Use HAVING to filter groups after the aggregation.

SELECT category, COUNT(*) 
FROM products 
GROUP BY category
HAVING COUNT(*) > 5;

Task: Find which status has more than 1 order.

Loading...
Run a query to see results