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
can’t be used if aggregation is not performed. Use WHERE
instead.
当前内容版权归 ClickHouse 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ClickHouse .