MySql教程

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 语句。

这篇关于Mysql 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregate 报错解决方案的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!