HAVING
Syntax of Analysis Statements
The syntax of a complete analysis statement is as follows:
1 2 3 4 | SELECT [DISTINCT] (* | expression) [AS alias] [, ...] [GROUP BY expression [, ...] [HAVING predicates]] [ORDER BY expression [ASC | DESC] [, ...]] [LIMIT size OFFSET offset] |
The HAVING syntax specifies the conditions for filtering group results (GROUP BY) or aggregation calculation results. The following part describes parameters and examples for the HAVING syntax.
Example statement: Query data where the value of MIN(balance) exceeds 10000 and group the values of MAX(balance) by age.
Filters data based on grouping and Aggregate Functions.
1 | *|SELECT age, MAX(balance) GROUP BY age HAVING MIN(balance) > 10000 |
| age | MAX(balance) |
|---|---|
| 28 | 32838 |
| 32 | 39225 |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot