Live SQLite 3.54 Sandbox
SQL HAVING (Filtering Groups) (with live sandbox)
WHERE filters individual rows before grouping; HAVING filters aggregated groups after GROUP BY (like PivotTable Value Filters).
Syntax
SELECT category, SUM(amount) AS total FROM orders GROUP BY category HAVING SUM(amount) > 20;Return category and SUM(amount) AS total only for categories where SUM(amount) > 20.
SQLite 3.50 SandboxCtrl/Cmd + Enter to Run (unlimited & ungraded)
Practise HAVING (Filtering Groups) in our free SQL track
Same streak & XP across Excel, Google Sheets, and SQL.
Free 1-Page Excel, Google Sheets & SQL Interview Cheat Sheet
The 25 formulas, keyboard shortcuts, and SQL patterns tested most in analyst interviews — emailed instantly, zero spam.