系统上线时,报错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。
因为当前SQL 运行模式为 ONLY_FULL_GROUP_BY,该模式要求 SELECT 列表中的所有非聚合字段必须出现在 GROUP BY 子句中,或者与 GROUP BY 列中的字段存在函数依赖关系。
最简单的办法就是禁用 ONLY_FULL_GROUP_BY
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));