记录一下关于mysql的一个报错问题解决方案:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column ‘yunva_changke.u.user_id’; this is incompatible with sql_mode=only_full_group_by
问题描述:是因为mysql的sql_mode默认开启了only_full_group_by 模式,导致Mysql的Sql的group by规则跟Oracle类似了,所以去掉这个默认就可以了
具体方法:
1.查看sql_mode模式,如果sql_mode显示为:only_full_group_by,执行步骤二即可
mysql>show variables like ‘%sql_mode’;
mysql> show session variables like ‘%sql_mode%’;
mysql> show global variables like ‘%sql_mode%’;
2.
mysql> set global sql_mode=”;
mysql> set session sql_mode=”;
具体转载:https://blog.csdn.net/reblue520/article/details/52541176