MySQL分组查询时出现错误SELECT list is not in GROUP BY ;this is incompatible with sql_mode=only_full_group_by

来源:互联网 发布:mac版的photoshop cc 编辑:程序博客网 时间:2024/05/21 22:51

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'chapter04.student.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

解决方法:

修改MySQL的配置文件

vi /etc/mysql/my.cnf

添加语句sql_mode='NO_ENGINE_SUBSTITUTION'

然后重启数据库 /etc/init.d/stop    /etc/init.d/start



阅读全文
0 0