MySQL-Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre
2021/12/10 2:17:34
本文主要是介绍MySQL-Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'a_id' which is not functionally
dependent on columns in GROUP BY clause;this is incompatible with sql_mode=only_full_group_by
解决方案
- 先使用 SQL 查询
select @@global.sql_mode
查出来的值为:
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
- 此时去掉ONLY_FULL_GROUP_BY,然后重新设置值(引号中填写裁剪后的字符串)
set @@global.sql_mode='';
这篇关于MySQL-Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-20部署MySQL集群入门:新手必读指南
- 2024-11-20部署MySQL集群教程:初学者指南
- 2024-11-20部署MySQL集群项目实战:新手教程
- 2024-11-20部署MySQL集群资料:新手入门教程
- 2024-11-20MySQL集群部署教程:入门级详解
- 2024-11-20MySQL集群教程:入门与实践指南
- 2024-11-20部署MySQL集群教程:新手入门指南
- 2024-11-20MySQL读写分离教程:轻松入门
- 2024-11-20部署MySQL集群入门:一步一步搭建你的数据库集群
- 2024-11-19部署MySQL集群学习:入门教程