【解决MySQL问题1】Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated…
MySQL 5.7.5后only_full_group_by成为sql_mode的默认选项之一,这可能导致一些sql语句失效。比如下表games:
执行语句:select group_id,name from games group by group_id
返回(错误):Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘game.name’ which is not…
解决方法:
在配置文件 my.ini 中,添加 sql_mode=
,具体如下:
然后 ‘保存’ ,最后‘ 重新启动MySQL服务’(如下)可以解决此类问题。
执行后: