mysql关闭严谨模式

查看mysql是否启用ONLY_FULL_GROUP_BY

select @@global.sql_mode

mysql 5.7+中 默认启用了 ONLY_FULL_GROUP_BY
是一种严谨的SQL模式

如有则删除

SET SESSION sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

否则报错

SELECT list is not in GROUP BY clause and contains nonaggregated column ‘kirinpay.payout_statistics_day.date’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

发表评论

邮箱地址不会被公开。