Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'zl.tm.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
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, HAVING conditions, or ORDER BY list query references that are neither named non-collection columns in the GROUP BY clause, nor are they functionally dependent on them. (Before 5.7.5, MySQL did not detect functional dependencies, and ONLY_FULL_GROUP_BY is not enabled by default.
1. Query mysql related mode
select @@global.sql_mode;
You can see that ONLY_FULL_GROUP_BY is included in the pattern, as long as there is no such configuration. A
My MySQL version is 5.7.21, the default is with ONLY_FULL_GROUP_BY mode.
2. Reset the mode value
Set via configuration file: vim /etc/my.cnf
Add the following configuration to my.cnf (my.ini):
[mysqld]
sql_mode='The mode you want'
Such as:
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
In windows as shown:

In query mode:

There is no ONLY_FULL_GROUP_BY mode anymore.
The test sql query was successful.
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 ...
problem: the reason: solve:...
Original link: https://blog.csdn.net/loveliness_peri/article/details/88051316 The reason for the problem: there are more in sql_mode:ONLY_FULL_GROUP_BY Use SQL statements to query this configur...
When using MySQL to perform Group By query statement, error: problem causes The SQL standard does not allow the Select list, a Having condition statement, or a grouse in the Group By in the Order by s...
During the query with laravel, Daravel this is incompatible with sql_mode = only_full_group_by Looked online, because MySQL version is compatible, I use 5.7, add [mysql] and [mysqld], add additional f...
When querying a database, the following error occurs: Details are as follows: This is caused by improperly setting sql_mode. Modify sql_mode to: Inquire: 1. Method 1 modify Check again: This modificat...
1. Reason of error After MySQL 5.7.5, only_full_group_by becomes one of the default options of sql_mode, which may cause some SQL statements to fail. For example, when group by is used for group query...
Today I wrote such a SQL statement in Mysql on my personal server: The execution even reported an error, the error information is as follows: My Mysql version is 5.7.22, which was newly installed when...
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_c...
Edit the mysql configuration file (windows is my.ini, linux is my.cnf), add the following configuration under [mysqld]: Just restart the MySQL service...