ClickHouse/docs/en/sql-reference/statements/select/having.md
Ivan Blinkov 7170f3c534
[docs] split aggregate function and system table references (#11742)
* prefer relative links from root

* wip

* split aggregate function reference

* split system tables
2020-06-18 11:24:31 +03:00

708 B
Raw Blame History

toc_title
HAVING

HAVING Clause

Allows filtering the aggregation results produced by GROUP BY. It is similar to the WHERE clause, but the difference is that WHERE is performed before aggregation, while HAVING is performed after it.

It is possible to reference aggregation results from SELECT clause in HAVING clause by their alias. Alternatively, HAVING clause can filter on results of additional aggregates that are not returned in query results.

Limitations

HAVING cant be used if aggregation is not performed. Use WHERE instead.