为什么加了group by 就报错了
错误截图:
错误截图:
2018-08-02
我也遇到这个问题,不过是mysql配置的问题,我把解决办法贴出来给遇到同样错误的人作一些参考
ERROR 1055 (42000): Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.s.type_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
修改设置
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
举报