在MySQL 8中,当你遇到错误消息:"which is not in select list; this is incompatible with distinct"时,这通常意味着你在使用DISTINCT关键字的查询中,ORDER BY子句引用了一个不在SELECT列表中的列。下面是对这个错误的详细解释和解决方案: 1. 解释错误消息 这个错误消息表明,当你尝试对一个使用DISTINCT关键字的查...
1.在该模式下,我们使用GROUP BY查询时,出现在SELECT字段后面的只能是GROUP BY后面的分组字段,或使用聚合函数包裹着的字段,否则会报错如下信息: 1 Expression #1ofSELECTlistisnotinGROUPBYclauseandcontainsnonaggregatedcolumn'database.table.column'whichisnotfunctionally dependentoncolumnsinGROUPBYclause; thisisincompa...
1.在该模式下,我们使用GROUP BY查询时,出现在SELECT字段后面的只能是GROUP BY后面的分组字段,或使用聚合函数包裹着的字段,否则会报错如下信息: Expression#1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'database.table.column' which is not functionally dependent on columns in...
'whichisnotinSELECTlist; thisisincompatiblewithDISTINCT 二、这个问题是5.7版本的sql_mode为ONLY_FULL_GROUP_BY模式时的问题。 三、处理方式修改my.cnf [mysqld]sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION...
--- Cause: java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, references column 'ddfei.t2.add_time' which is not in SELECT list; this is incompatible with DISTINCT at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement....
Expression #2 ofSELECT list is not in GROUP BY clause and contains nonaggregatedcolumn ‘sss.month_id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 问题出现的原因:MySQL5.7.5及以上功能依赖检测功能。如果启用了ONLY_FULL...
MySQL for OEM/ISV Over 2000 ISVs, OEMs, and VARs rely on MySQL as their products' embedded database to make their applications, hardware and appliances more competitive, bring them to market faster, and lower their cost of goods sold. ...
产生原因说是,在MySQL数据库版本为5.7以上的版本,默认开启了 ONLY_FULL_GROUP_BY SQL模式,在此模式下,对于group by操作,如果在select语句中的查询列没有在group by中出现,那么这个SQL就是非法的,因为列不在group by语句中,所以设置了sql_mode=only_full_group_by的数据库,在使用group by时就会报错。
1055(42000): SELECT list is not in GROUP BY clause and contains nonaggregated column 原因与解决方案 该报错主要是因为sql_mode参数被修改导致: 原因一:用户修改sql_mode参数导致GROUP BY的语法不合规 原因:用户修改了sql_mode参数,添加了ONLY_FULL_GROUP_BY条件,导致GROUP BY的语法不符...
Description: SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'dbname.content_moderation_state.moderation_state' which is not in SELECT list; this is incompatible with DISTINCT: SELECT DISTINCT "node_field_data"."langcode" AS "...