ClickHouse/docs/en/sql-reference/statements/select/having.md
Ivan Blinkov aa17da6b68
[docs] adjust SELECT ToC meta (#10942)
* [docs] adjust SELECT ToC meta

* Update array-join.md

* Update distinct.md

* Update format.md

* Update from.md

* Update group-by.md

* Update having.md

* Update into-outfile.md

* Update join.md

* Update limit-by.md

* Update limit.md

* Update order-by.md

* Update prewhere.md

* Update sample.md

* Update union-all.md

* Update where.md

* Update with.md
2020-05-15 14:25:18 +03:00

611 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.