Home >Database >Mysql Tutorial >How to Fix MySQL's 'only_full_group_by' Error in Queries?
MySQL 5.7 version introduced "Only_full_group_by" SQL mode, causing some query statements that could be running normally before. This error occurred in the SELECT list that contains a non -polymerization column that does not list in the group by clause and has a column that does not have a function dependencies in the Group By clause.
The solution is to add
columns to the group by clause to make the query statement in line with the "Online_Full_group_by" mode. This can ensure that each different and combination has only one line of results. group_id
group_id
The best practice is to use table names or alias to limit all columns, especially when processing multiple tables. This helps to avoid ambiguity and ensure the selected data. group_name
It is not recommended to disable the "only_full_group_by" mode
, because it helps ensure data integrity and accuracy. By containing non -aggregation columns in the Group By clause, MySQL can ensure the accuracy of the results and reflect the expected group data.
The above is the detailed content of How to Fix MySQL's 'only_full_group_by' Error in Queries?. For more information, please follow other related articles on the PHP Chinese website!