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
posted @ 2021-10-22 11:19  ki1616  阅读(105)  评论(0编辑  收藏  举报