This article is a mirror article of machine translation, please click here to jump to the original article.

View: 17809|Reply: 0

[Source] MYSQL 5.7.34 sets GROUP BY to display multiple columns

[Copy link]
Posted on 8/2/2021 6:59:43 PM | | | |
MySQL GROUP BY statement, the GROUP BY statement groups the result set based on one or more columns. On the grouped columns we can use functions such as COUNT, SUM, AVG, etc.

For a group by column, if you query multiple columns, execute the SQL statement, and the error will be reported as follows:

SQL Error [1055] [42000]: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'itsvse' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by


ONLY_FULL_GROUP_BY

For GROUP BY aggregation operations, if the columns in SELECT do not appear in GROUP BY, then this SQL is considered illegal because the columns are not in the GROUP BY clause


Set Allow SELECT columns without GROUP BY

Query 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
Query your matching value and remove the "ONLY_FULL_GROUP_BY" (Don't just copy mine through below

(End)




Previous:water
Next:Linux correctly closes the mongodb database
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com