1、问题
[Err] 1055 - Expression #1 of ORDER BY clause is not
in GROUP BY clause and contains nonaggregated column 'yysc.rjscid'
which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by
2、 解决办法
2.1、暂时关闭
- 先执行 select @@sql_mode 将值查询出来,然后将结果中的ONLY_FULL_GROUP_BY去掉
- set @@SESSION.sql_mode='去掉ONLY_FULL_GROUP_BY的@@sql_mode值';
2.2、永久解决
- linux下使用vim 打开mysql /etc/my.cnf(windows是安装目录下的my.ini)文件,加上以下配置,然后重启
sql_mode=select @@sql_mode查出sql_mode以后去掉ONLY_FULL_GROUP_BY的值
来源:oschina
链接:https://my.oschina.net/u/4111991/blog/4940904