Help Center/ Data Lake Insight/ HetuEngine SQL Syntax Reference/ HetuEngine SQL Syntax/ DQL Syntax/ HAVING
Updated on 2025-08-06 GMT+08:00
HAVING
HAVING
HAVING is used with aggregate functions and GROUP BY to control which groups are selected. HAVING filters out groups that do not meet specified conditions after grouping and aggregation calculation.
Example:
SELECT count(*), mktsegment, nationkey, CAST(sum(acctbal) AS bigint) AS totalbal FROM customer GROUP BY mktsegment, nationkey HAVING sum(acctbal) > 5700000 ORDER BY totalbal DESC;
Parent topic: DQL Syntax
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.