This is incompative with sql_mode = only_full_group_by mysql group by cannot take effect

tags: SpringBoot-MyBatisPlus  mysql  sql  database

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘XXXX’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

I encountered a MySQL version problem when doing paging; the above errors occurred when using the group by paging in the MySQL version 5.7 or more.

Run mysql statement

SELECT @@GLOBAL.sql_mode; SELECT @@SESSION.sql_mode;

search result


Save the query results

Windows found in mysql installation directorymy.ini file

Add below ** [mysqld] **

sql_mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

This configuration

Delete after addingONLY_FULL_GROUP_BY

sql_mode = TRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

If you aremy.ini fileThere are sql_mode configuration in the file and in the configurationONLY_FULL_GROUP_BY Can be deleted directly

Remember to restart mysql after deleting it, otherwise the configuration cannot take effect

Intelligent Recommendation

"This is incompative with sql_mode = only_full_group_by" Quick solution method

1. Reasons for the problem MySQL 5.7, realize the dependencies of detection functions. If it is enabledONLY_FULL_GROUP_BY SQL mode (default),MySQLRefuse to choose a list query, conditions, or command ...

"This is incompative with sql_mode = only_full_group_by" error solution (MAC system)

1. Principle level This error occurred in the MYSQL 5.7 version and above. The default SQL configuration of MySQL 5.7 is: sql_mode = "only_full_group_by", which strictly executes the "S...

When mysql uses group by, it encounters sql_mode=ONLY_FULL_GROUP_BY

About sql_mode, you can view When sql_mode=ONLY_FULL_GROUP_BY, this sql will report an error. After clearing the value of sql_mode (the value of sql_mode in Alibaba Cloud RDS database is empty), the a...

MySQL uses group by to report an error sql_mode=only_full_group_by

mysql opens only_full_group_by mode. In this mode, using the old version of mysql to get group by group data will report an error, the error is as follows: `Expression #3 of SELECT list is not in GROU...

Mysql 5.7 group by prompt SQL_MODE = ONLY_FULL_GROUP_BY

Check SET global Set the current library...

More Recommendation

MySQL uses group by error SQL_MODE = only_full_group_by modifies SQL_MODE in Session in Navicat

Check SQL_MODE results returned by mysql8 Remove the only_full_group_by this SQL_Mode, the operation is as follows: Then execute the SQL statement will not report an error, this is just modifying SQL_...

Mysql group by this is incompatible with sql_mode=only_full_group_by Mysql 5.7 version group by problem

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by When executing a colleague's sql, I found that group by has a problem. select m...

Mysql error sql_mode=only_full_group_by

Remember once, when you migrate the service, connect to the new database, the database is also the backup of the previous, found an error:   I started thinking that it was wrong when I imported i...

Mysql this is incompatible with sql_mode=only_full_group_by

MySQL reasonable set of sql_mode sql model used to solve the following types of problems (1) By setting sql mode, can perform different stringency data check, data preparation of effective protection....

mysql incompatible with sql_mode=only_full_group_by

Solution my.cnf adds a piece of data sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION   service mysqld restart resta...

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

Top