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 list is not in GROUP BY clause and contains nonaggregated

 

 

 

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
上一篇:mysql ALTER TABLE 并发控制


下一篇:c# – PDFsharp水印