我最近在RDS上从v5.6升级到MySQL v5.7。Amazon RDS MySQL only_full_group_by
现在,我有时会收到错误:
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'USER.t.training_team_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
我检查我的配置与SELECT @@ GLOBAL.sql_mode只有得到:
NO_ENGINE_SUBSTITUTION
然而,这仍然发生。
奇怪的是,它只发生有时。我不能强迫它发生,我似乎无法禁用only_full_group_by选项。
我该如何改变?
http://stackoverflow.com/questions/31058210/how-to-set-amazon-rds-sql-mode-with-multiple-values –
不要假设你的当前'@@ SQL_MODE'等于全局模式。 'SELECT @@ SESSION.sql_mode;'并进行比较。然而,错误是试图警告你,你写的查询不是确定性的,并且可能会给你一个意外的正确答案。 –
我用'SELECT @@ SESSION.sql_mode;' – Oxholm