数据库报错:Column 'temTable.customStatus' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
原因:group by 后面是要跟着的 select 中所有不是聚合函数的字段。
解决:把该字段放在group by 后面即可。

本文详细解释了在SQL查询中遇到的'Column 'temTable.customStatus' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.'错误的原因,并提供了简单有效的解决方案,只需将未包含在聚合函数中的字段添加到GROUP BY子句中即可。
原因:group by 后面是要跟着的 select 中所有不是聚合函数的字段。
解决:把该字段放在group by 后面即可。

669
4613
3698

被折叠的 条评论
为什么被折叠?