MYSQL报错:1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column

1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
'rpacloudsit.t.app_id' which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by

MySQL has any_value (field) function, his main role is to inhibit ONLY_FULL_GROUP_BY value is rejected

Official presentations, address: https: //dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_any-value

We can select attribute query statement (in addition to the desired polymerization function parameters), all placed any_value (field) function;

例如:select name,any_value(sex) from test_table group by name

Such sql statement, whether state or closed ONLY_FULL_GROUP_BY mode can be performed in the normal mode is turned on, do not be rejected mysql.

Guess you like

Origin www.cnblogs.com/yoyotl/p/11964460.html