Amazon RDS MySQL only_full_group_by

Amazon RDS MySQL only_full_group_by,mysql,amazon-web-services,rds,Mysql,Amazon Web Services,Rds,我最近在RDS上从v5.6升级到MySQL v5.7 现在我有时会出现错误: 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 sq

我最近在RDS上从v5.6升级到MySQL v5.7

现在我有时会出现错误:

 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_模式检查了配置,只得到:

 NO_ENGINE_SUBSTITUTION
然而,这种情况仍然存在

奇怪的是,这只是偶尔发生。我不能强迫它发生,我似乎不能禁用唯一的“完整”组“按选项”

如何更改此设置?

我找到了修复程序

我浏览了所有视图,并在给出错误的列中添加了“ANY_VALUE()”


我希望这有助于处于相同位置的其他人:)

不要假定您当前的
@@SQL\u模式等于全局模式<代码>选择@@SESSION.sql_模式并比较。不过,该错误试图警告您,您的查询(如所写)不是确定性的,可能会意外地给您一个正确的答案我也遇到了这个问题,然后我阅读了GroupBy的文档,意识到我不需要那些额外的专栏,或者我真正需要的是其他东西。可以通过以下方式仅禁用\u full\u group\u: