in GROUP BY clause; this is incompatible with sql_mode=

MySql 码拜 8年前 (2016-02-08) 1018次浏览
[Err] 1055 – Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column “xxx.xxx.id” which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
这个错误怎么解决?
linux下 5.7数据库。
看网上的说话修改 /etc/my.cnf 文件
sql_mode=”NO_ENGINE_SUBSTITUTION

sql_mode=”STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
都不管用,一直报这个错误!求指导!
扩展链接:
http://blog.csdn.net/lwei_998/article/details/40431049
http://zhidao.baidu.com/link?url=vEv06LSZdcr0boLCK54RbTLu9gJgetu5VB-Z_PfVfPBNWymJISgV_Qr7MakNSiLfN99O3DbvBUIqL8NRK5oFFUg591z_WSm3czOWCLJyIl3
求指导求指导求指导!
解决方案

40

进入MYSQL后检查
SELECT @@GLOBAL.sql_mode;
SELECT @@SESSION.sql_mode;
以供分析。 假如其中存在 ONLY_FULL_GROUP_BY  则去掉。

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明in GROUP BY clause; this is incompatible with sql_mode=
喜欢 (0)
[1034331897@qq.com]
分享 (0)