其他分享
首页 > 其他分享> > SELECT list is not in GROUP BY clause and contains nonaggregated

SELECT list is not in GROUP BY clause and contains nonaggregated

作者:互联网

一、错误

> 1055 - Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'n.wifi_mac' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

二、查询

SELECT @@sql_mode;
结果
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

三、修改/etc/my.cnf文件,添加sql_model(把ONLY_FULL_GROUP_BY删掉)

 

 

 

SELECT @@sql_mode;
结果
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

标签:nonaggregated,GROUP,NO,clause,ZERO,sql,DATE,SELECT
来源: https://www.cnblogs.com/ki16/p/15437944.html