In aggregated query without GROUP BY
1、问题:
查询语句:
select count(support) supportCount,count(collection) collectionCount, support,collection
from like_collect where articleId = 2;(注意:此处未使用group by语句声明非聚集函数列)
报错描述:In aggregated query without GROUP BY, expression #3 of SELECT list contains nonaggregated column 'pet.like_collect.support'; this is incompatible with sql_mode=only_full_group_by
2、分析报错原因:
mysql的sql_mode默认开启了only_full_group_by 模式
3、解决方法:
把SQL语句中非聚集函数列再group by后声明即可
select count(support) supportCount,count(collection) collectionCount, support,collection
from like_collect where articleId = 2 GROUP BY support,collection;
In aggregated query without GROUP BY相关推荐
- In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column...
ERROR 1140 (42000): In aggregated query without GROUP BY, expression #1 of SELECT list contains nona ...
- In aggregated query without GROUP BY报错
记录一下关于mysql的一个报错问题解决方案:In aggregated query without GROUP BY, expression #1 of SELECT list contains n ...
- mysql查询出现In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated c
1.问题: Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In ...
- In aggregated query without GROUP BY是什么错误
本文所使用的表: 表 sc ±-----±------+ | sid | score | ±-----±------+ | 01 | 80.0 | | 01 | 90.0 | | 01 | 99.0 ...
- mysql:In aggregated query without GROUP BY, expression #1 of SELECT list contains...........
文章目录 问题描述 问题溯源 解决方式一 解决方法二 附录: 问题描述 下面是报错截图: 1140 - In aggregated query without GROUP BY, expression ...
- MYSQL||报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated
碎碎念: 兄弟萌,我胡汉三又回来啦(。・∀・)ノ゙嗨,最近在期末考,一不小心二十几天没发博了,年底KPI没冲成功,今天就来补一下下§(* ̄▽ ̄*)§ 一.问题描述 今天在牛客网做SQL的题:牛客的课程 ...
- mysql 报错:1140 In aggregated query without GROUP BY, expression #
1140 In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated colum ...
- MySQLSyntaxErrorException: In aggregated query without GROUP BY聚合查询语法异常
MySQLSyntaxErrorException: In aggregated query without GROUP BY,this is incompatible with sql_mode=o ...
- mysql报错In aggregated query without GROUP BY
执行语句: select de.dept_no, count(s.salary) from salaries s left join dept_emp de on s.emp_no = de.emp_ ...
最新文章
- 八年级计算机网络公开课,计算机网络公开课教案.doc
- 如何在Python中对字符串进行子字符串化
- init/main.c中的void init(void)
- java象棋无框架版_Java版中国象棋
- 微软云创益大赛获奖团队风采:做一个中国特色的.Net源代码社区
- ubuntu14中 memcached安装与使用
- python中获取python版本号的方法
- 【Java心得总结六】Java容器中——Collection
- 嵌套查询和连接查询的效率_Elasticsearch 7.x Nested 嵌套类型查询 | ES 干货
- RabbitMQ笔记-使用rabbitmq-c实现Fair dispatch(公平分发)
- 分布式监控系统ganglia配置文档
- 阿里云 centos mysql 5.6_关于centOS安装配置mysql5.6那点事
- ubuntu终端执行shell脚本报command not found解决方法
- POJ3618 Exploration【水题+排序】
- 如何使用Tuxera NTFS for Mac禁用特定NTFS分区
- win10图片打不开无法注册包
- Java项目:基于jsp+mysql+Spring+SpringMVC+mybatis的高速公路收费管理系统
- Excel 固定显示表头 / 列头
- 中台之上(三):战略和组织结构,业务架构设计中不应被忽视的关键因素
- Python停车管理系统毕业设计-附源码271400