数据库
首页 > 数据库> > Mysql 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregate 报错解决方案

Mysql 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregate 报错解决方案

作者:互联网

报错信息:1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘xxxx.xxxx.xxx’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by, Time: 0.000000s

在SQL 或 Navicat 中执行 :

set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

备注:需要选择到对应数据库,在执行该sql语句。不然就会出现在这个这个库可以执行,但是其他库不能执行group by 语句。

标签:nonaggregate,GROUP,NO,clause,ZERO,报错,sql,DATE
来源: https://www.cnblogs.com/junzibuqing/p/16434404.html