ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregate

When mysql 5.7 first uses group by, an error occurs. First, the table information is as follows:
       ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘test.score.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

select c_name,id from score group by c_name;


Check out the check mode of MySQL5.7

Remove the ONLY_FULL_GROUP_BY item by modifying the my.cnf or my.ini configuration file (created if there is no such configuration item)
add the following line to the file

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 restart mysql
will not appear ONLY_FULL_GROUP_BY at this time

Intelligent Recommendation

Mysql uses group by to group, and now the error is ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and

Error message: analysis: ONLY_FULL_GROUP_BY means: For GROUP BY aggregation operations, if the column in the SELECT does not appear in the GROUP BY, then this SQL is illegal, because the column is not...

MySQL Question: Error 1055 (42000): Expression # 2 of SELECT LIST IS Not in Group By

Problem Description: ERROR 1055 (42000): Expression # 2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'commodity.a.xsjg' which is not functionally dependent on columns in ...

Error Code: 1055. Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated

SQL92 and earlier versions do not allow the selection list,HAVINGConditions orORDER BYIn the list of referencesGROUP BYClause of a query non-grouping columns unnamed. For example, in the SQL92 standar...

[42000][1055] Expression #1 of SELECT list is not in GROUP BY clause of MySQL

Questions raised MySQL data table query statement: Prompt the following error message: The definition of the t_user table is as follows: MySQL information Enter commands on the MySQL command line or c...

ERROR 1055 (42000): Expressionof SELECT list is not in GROUP BY clause sql_mode=only_full_group_by

ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘mome.a.type’ which is not functionally dependent on columns in GROUP BY clause...

More Recommendation

Error 1055 (42000): Expression # 1 of SELECT LIST IS Not in Group by Clause (2020 MAC)

Question: You can't use Group By packet query under Mac, as shown below Workaround: Modify the value of the variable SQL_MODE Specific steps: 1, MAC's mysql configuration file is /library/launchdaemon...

mysql error 1140 In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregate

In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column'szmz_zhbz_gov.b.cremation_time'; this is incompatible with sql_mode=only_full_group_by After reviewing ...

MySQL error> 1055 - expression # 1 of success list is not in group by clause and contacts nonaggregate

Database query 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘dkia_quality_db.b.id’ which is not functionally dependent on columns in GROU...

Mysql group by group error Error 1055 (42000): Expression #2 of Select list is not in group by class

cause The reason is that in the version of the MySQL database version of 5.7 or more, the only_full_group_by SQL mode is turned on by default. In this mode, if you operate in the group by, if the quer...

1055-Expression #1 of SELECT list is not in GROUP BY clause and contains

During the development process today, because the previous project has been developed and the database migration has been completed, during the operation today, an error occurred when summing up by gr...

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

Top