Glossary term
What is HAVING? Meaning for developers
Filters groups after aggregation, while WHERE filters rows before it.
Learn it properly · SQL & PostgreSQLLesson 2: Aggregates, GROUP BY and HAVINGCOUNT, SUM and AVG, GROUP BY rules, HAVING versus WHERE, FILTER, date_trunc reports and the order a SELECT is evaluated.