SELECT group_by_column, AGG_FUNC(column_expression) AS aggregate_result_alias, …FROM mytableWHERE conditionGROUP BY columnHAVING group_condition; HAVING和WHERE语法一样,只是作用的结果集不同。