1. 使用SQL查询sql_mode
select @@global.sql_mode
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
2. 重新设置sql_mode,删除ONLY_FULL_GROUP_BY
set @@global.sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
设置值根据自己数据库配置设置,解决不能group by,只删除ONLY_FULL_GROUP_BY即可