tags: Mysql
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 GROUP BY clause and contains nonaggregated column ‘wenming-bj-mtg.comments.organization_id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Time: 0s`
The ONLY_FULL_GROUP_BY configuration enables "strict ANSIsql rules". The strict ANSI sql rules require that there are no aggregated columns when group by. When group by, all must be included in the field of group by.
Without turning off the ONLY_FULL_GROUP_BY mode, the columns that do not use aggregate functions will be connected to the fields that need group by. The sql is as follows:
SELECT obj_id, area_id, organization_id, stars FROMcommentsWHEREarea_3= 2424 ANDtype= 2 ANDenabled= 1 ANDcreated_at>= '2020-05-02 00:00:00' ANDcreated_at<= '2020-07-22 16:00:00' GROUP BY obj_id,organization_id,area_id,stars

That's it, if it helps you, please click ha.
problem: the reason: solve:...
During MySQL operation, the following errors are often reported: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘information_schema.PRO...
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...
my situation : Mysql 5.7.21 version runs sql and reports the same error. The same sql runs directly locally without error. However, this error occurs when connecting to Mysql on the server (even runni...
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...
Scenario: The same product, different models, there are different prices, such as 1 mobile phone has 128G, 2,256g, 2500 yuan, but the product display page, the price shows 2,000 yuan, if it is a produ...
Database removing duplicate data, the data needs to be packed and one of them is displayed. The group by statement may be used. However, if MySQL is above 5.7 or more, when the group by is executed, i...
Erusion page information Probably means: grammatical errors or access conflict, the expression is not in the conditions of group by, and this is withsql_mode=only_full_group_byIncompatible This error ...
1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'XXX' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_m...