如果列已经是聚合函数的一部分,则不会自动添加到GROUP by子句中。
Columns are not automatically added to the GROUP BY clause if they are already part of an aggregate function.
所以,即使数据列不是 GROUP BY 子句的一部分或者不包含在聚合函数中,也可以在 WHERE 子句中使用它。
Therefore, you can use a data column in a WHERE clause even if it is not part of the GROUP BY clause or contained in an aggregate function.
当选择“分组依据”选项或将聚合函数添加到查询中时,所有标记为输出或用于排序的列将自动添加到GROUP by子句中。
When you choose the GROUP BY option or add an aggregate function to a query, all columns marked for output or used for sorting are automatically added to the GROUP BY clause.
应用推荐