SELECT list is not in GROUP BY clause and contains

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SELECT list is not in GROUP BY clause and contains相关的知识,希望对你有一定的参考价值。

查询mysql 相关mode

select @@global.sql_mode;

可以看到模式中包含了ONLY_FULL_GROUP_BY,只要没有这个配置即可。
我的Mysql版本是5.7.21,默认是带了ONLY_FULL_GROUP_BY模式。

ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,
ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

2.重设模式值

set @@global.sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE, <br/>ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION;

以上是关于SELECT list is not in GROUP BY clause and contains的主要内容,如果未能解决你的问题,请参考以下文章

SELECT list is not in GROUP BY clause and contains nonaggregated

SELECT list is not in GROUP BY clause and contains nonaggregated column

SELECT list is not in GROUP BY clause and contains

linux下order by 报出ORDER BY clause is not in SELECT list

MySQL出现“SELECT list is not in GROUP BY clause and contains xxx”错误提示

mysql问题解决SELECT list is not in GROUP BY clause and contains nonaggregated column