clause
HAVING
Filters groups rather than individual input rows. Example target: PostgreSQL 17 and SQLite (local fixture tested).
Formal Syntax & Structure
sql syntaxsql
HAVING conditionWorking Example
Example Snippetsql
SELECT customer_id, COUNT(*) FROM orders GROUP BY customer_id HAVING COUNT(*) > 1;