mysql 报错,不太懂
迷茫
迷茫 2017-04-17 16:17:16
0
5
668
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(5)
Ty80

The fields after normal select can only be fields in group by or aggregate functions, for example:

select a,max(b) from t group by a;

But you will find that sometimes other people’s mysql is written like this,

select a,b,max(c) from t group by a;

Why don’t others report errors?
Pay attention to the last sentence of the error messagesql_mode=only_full_group_by
sql_mode is used to check the legality of the SQL statement. When configured as only_full_group_by, the select field is either the result of the aggregate function or the result of group by field value in .
Therefore, if you want to ensure that the original sql is executed normally, you can modify the configuration of my.cnf. Comment out sql_mode=only_full_group_by and add a # sign in front

大家讲道理

You groupby ymf.u.uid but you didn’t put it in the select field?

巴扎黑

Post the sql together

大家讲道理

When you use group by, the field you want to select must be in group by, except for aggregate queries.

迷茫

Thanks for the invitation. If possible, please post your code. If there is an error, it should be that the field you are querying is not in GROUP BY. For details, it still depends on your sql statement.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template