tags: Mysql

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 the information, we learned that group by has been optimized after MySQL version 5.7. By default, the improved version starts the ONLY_FULL_GROUP_BY mode.
That is, ONLY_FULL_GROUP_BY is a sql_mode provided by the MySQL database. This sql_mode is used to ensure the validity of the SQL statement "grouping for the most value". This mode adopts the processing method with Oracle, DB2 and other databases. That is, columns with ambiguous semantics are not allowed in the select target list.

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 GR...
sql statement error contents: Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP BY, expression #1 of SELECT list contains non...
1. Reason Such an error in aggregate query is because the mode set by mysql contains ONLY_FULL_GROUP_BY Two, modify Modify in the configuration file Then restart the service Three, cause...
Shatter Brother Meng, I Hu Han San is coming back again (.. ∀ ·) ノ゙ ノ゙¯ ▽ ¯ *) § First, the problem description Today, I do SQL in the cow passenger net: the course of the...
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test1.p.type_id' which is not functionally dependent on columns in GROUP BY clause; this i...
There is no problem running on MySQL 5.5.27. The error of sql_mode=only_full_group_by is reported on MySQL 5.7.24: Error 1140: In aggregated query without GROUP BY, expression #1 of SELECT list contai...
phenomenon: Performing sql SELECT COUNT (DISTINCT (colum1)), colum2, colum3 FROM table; error ERROR 1140 (42000): In aggregated query without GROUP BY ..... the reason: sql_mode default mysql opens up...
【phenomenon】 【solve】...
Execute a statement: select de.dept_no, count(s.salary) from salaries s left join dept_emp de on s.emp_no = de.emp_no; Complete error message: In aggregated query without GROUP BY, expression #1 of SE...
the reason MySQL 5.7.5 and above functions depend on the detection function. If ONLY_FULL_GROUP_BY is enabled SQL mode (by default), MySQL will reject the select list, HAVING condition or ORDER BY lis...