columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by mysql8.0解决办法
控制台报错如下:
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
原因:
mysql5.7以上默认开启了only_full_group_by选项。我的版本是mysql8.0以上的
解决:
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION