clause

HAVING

Filters groups rather than individual input rows. Example target: PostgreSQL 17 and SQLite (local fixture tested).

Formal Syntax & Structure

sql syntaxsql
HAVING condition

Working Example

Example Snippetsql
SELECT customer_id, COUNT(*) FROM orders GROUP BY customer_id HAVING COUNT(*) > 1;
SQL Reference