mysql5.7 query error this is incompatible with sql_mode = only_full_group_by

The server is running normally, and an error occurs when the machine is running
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘mgl.db_mglmro_customer_customercar.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
After consulting the relevant information, I made the following conclusions:
mysql5.7.x version, the only_full_group_by mode is enabled by default. After this mode is turned on, the original group by statement will report an error, so the solution is to delete this mode.
execute in MySQL database

select @@global.sql_mode;

The result is as follows: you can see the only_full_group_by in the first line

Reset sql_midel and execute the following statement

set @@global.sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

Then just query it again:

Once only_full_group_by is turned on, it feels that group by will become the same as distinct, only the field information affected by it can be obtained, and cannot coexist with other fields not affected by it. Will become very narrow

Only_full_group_by mode is better.

Because there is a function in mysql: any_value (field) allows, the appearance of non-grouped fields (the same effect as turning off only_full_group_by mode).

Intelligent Recommendation

mysql error this is incompatible with sql_mode = only_full_group_by

mysql5.7 + version is turned on by defaultonly_full_group_byMode,When you turn on this mode, the column must query conditions are grouped. The original group by statement will be reported this error. ...

mysql error: this is incompatible with sql_mode=only_full_group_by

Solution: modify the mysql configuration file The local server can modify this Add under [mysqld] Then restart service mysql restart  ...

MySQL error: this is incompatible with sql_mode = only_full_group_by

Error scenario Today, I have a project that I just came down on my computer. When I log in to enter the home page, I reported a string of this is incompatible with sql_mode = only_full_group_by error,...

Mysql5.7.9 error this is incompatible with sql_mode = only_full_group_by

, I have been using a 5.6 version of MySQL. Recently, it is quite normal before 5.7.9. It is running very normal project error: Which is not functionally dependent on columns in group by clause; this ...

this is incompatible with sql_mode = only_full_group_by error resolution

I found it when I was running code on the host. this is incompatible with sql_mode=only_full_group_by Such a mistake, after an investigation, the final discovery is that the database on the host is ne...

More Recommendation

Mysql8 error: this is incompatible with sql_mode = only_full_group_by

MySQL8 version error: this is incompatible with sql_mode = only_full_group_by Use the following command to query the corresponding mode Solution, permanent resolution Modify MY.CNF [MySQLD], join this...

MySQL error [this is incompatible with sql_mode = only_full_group_by]

Report error message: Reporting error Mysql 5.7.5 and above function dependencies. If ONLY_FULL_GROUP_BY is enabled SQL Mode (By default), MySQL will refuse to select a list, the Having condition, or ...

SQL error: this is incompatible with sql_mode = only_full_group_by

First, scene Second, analysis 1, principle level 2, SQL level Third, solution 1. Foreword: View SQL_MODE configuration 2, the command solves 3, modify the My.ini file Fourth, SQL_MODE partial configur...

"This is incompatible with sql_mode = only_full_group_by" error record

Today, I brushed the Niuke.com, I got the most points of the person (2) "topic, From the inscription, you can use a temporary table to solve redundant code, the code is as follows SQL_ERROR_INFO:...

MySQL is using group by query error this is incompatible with sql_mode=only_full_group_by

The specific errors are as follows: the reason: MySQL 5.7.5 and above functions depend on the detection function. If ONLY_FULL_GROUP_BY SQL mode is enabled (by default), MySQL will reject select lists...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top