1. SELECT group_by_column, AGG_FUNC(column_expression) AS aggregate_result_alias,
    2. FROM mytable
    3. WHERE condition
    4. GROUP BY column
    5. HAVING group_condition;

    HAVING和WHERE语法一样,只是作用的结果集不同。