简体   繁体   中英

Amazon RDS MySQL only_full_group_by

I recently upgraded to MySQL v5.7 from v5.6 on RDS.

Now I sometimes get the error:

 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

I checked my config with SELECT @@GLOBAL.sql_mode and only get:

 NO_ENGINE_SUBSTITUTION

However this still happens.

The weird part is, that it only happens sometimes. I cannot force it to happen and I can't seem to disable the only_full_group_by option.

How do I change this?

I found the fix.

I went through all my views and added "ANY_VALUE()" to the columns that gave the error.

I hope this helps anyone else in the same position :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM