一 Group BY
1.1 问题描述
使用 Group By 时候出现:
ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘jol.solution.nick’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
1.2 原因分析
Mysql8.0默认开启了only_full_group_by选项。
1.3 解决方案:
在安装路径中,找到 my.ini 文件。
在 [mysqld] 中添加
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION