Expression #1 of SELECT list is not in GROUP BY clause and contains
nonaggregated column ‘数据库名.表名.字段名’ which is not functionally dependent
on columns in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by
长期解决方案 - 修改mysql配置文件
windows+PHPStudy+MySQL5.7修改
D:\phpstudy_pro\Extensions\MySQL5.7.26\my.ini
找到组[mysqld] (不是[mysql])
在组最后加一行
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
保存,重启电脑,即可