MYSQL报错:1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
'rpacloudsit.t.app_id' which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by
MySQL有any_value(field)函数,他主要的作用就是抑制ONLY_FULL_GROUP_BY值被拒绝
官方有介绍,地址:https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_any-value
我们可以把select语句中查询的属性(除聚合函数所需的参数外),全部放入any_value(field)函数中;
例如:select name,any_value(sex) from test_table group by name
这样sql语句不管是在ONLY_FULL_GROUP_BY模式关闭状态还是在开启模式都可以正常执行,不被mysql拒绝。
MYSQL报错:1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column的更多相关文章
- 【mybatis】【mysql】mybatis查询mysql,group by分组查询报错:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
mybatis查询mysql,group by分组查询报错:Expression #1 of SELECT list is not in GROUP BY clause and contains no ...
- mysql升级后出现Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo.
安装了mysql5.7,用group by 查询时抛出如下异常: Expression #3 of SELECT list is not in GROUP BY clause and contains ...
- Error Code: 1055.Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo.
环境:mysql-8.0.15-winx64 问题描述: Error querying database. Cause: java.sql.SQLSyntaxErrorException: Expre ...
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'blog.t_blog.addTime' which is not functi
sql报错: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT ...
- [mysql] Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'loser.tank_admin.login_ip' which is not functionally dependent on columns in GROUP BY clause; this is
执行SQL: SELECT login_name,login_ip,sex FROM tank_admin GROUP BY login_name ; 时抛出异常. Expression #2 of ...
- 记录一次mysql由5.6升级到5.7出现的异常---Expression #23 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'c.commentCount' which is not functionally dependent on columns in GROUP BY clause;
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expre ...
- Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column
Error: javax.servlet.ServletException: java.sql.SQLSyntaxErrorException: Expression #4 of SELECT lis ...
- Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo.
安装了mysql5.7,用group by 查询时抛出如下异常: Expression # of SELECT list is not in GROUP BY clause and contains ...
- Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
安装了mysql5.7.19后,执行语句中只要含有group by 就会报这个错 [Err] 1055 - Expression #1 of ORDER BY clause is not in GRO ...
随机推荐
- phpstorm goland webstorm jetbrain
1.去官网搞点安装包2.下载完之后一定要打开一下否则个别机型会出现包已损坏的错误提示3.下载Jet Brains License链接:https://pan.baidu.com/s/10nRk7Gei ...
- linux命令实现在当前文件夹下面模糊搜索文件
在当前文件中查找包含的字符串 find . -name "*.txt" | xargs grep 'abc' ,例如:查找txt文件中包含字符串a的字符串
- jenkins忘记admin密码的处理方法
如果忘记admin的登录密码,可按如下方法处理 # 编辑config.xml文件,替换passwordHash行的内容# vim /var/lib/jenkins/users/admin_167938 ...
- 解决Mac OS X 系统在home文件夹下面操作不支持的方法
解决Mac OS X 系统在home文件夹下面操作不支持的方法 最近需要使用Mac OS X 系统尝试安装使用appium程序,安装过程中发现,Mac OS X 系统在home文件夹下面操作不支持 ...
- 纯数据结构Java实现(11/11)(散列)
欢迎访问我的自建博客: CH-YK Blog.
- 图像处理基本工具——Python 环境下的 Pillow( PIL )
由于笔者近期的研究课题与图像后处理有关,需要通过图像处理工具对图像进行变换和处理,进而生成合适的训练图像数据.该系列文章即主要记录笔者在不同的环境下进行图像处理时常用的工具和库.在 Python 环境 ...
- C++对象内存模型2 (虚函数,虚指针,虚函数表)(转)
class A { public: virtual void vfunc1(); virtual void vfunc2(); void func1(); void func2(); virtual ...
- React.js Tutorial: React Component Lifecycle
Introduction about React component lifecycle. 1 Lifecycle A React component in browser can be any of ...
- 分享一个Centos8的国内yum源
使用的是清华大学开源镜像站,文件地址: https://github.com/hackyoMa/docker-centos/blob/8/CentOS-Base.repo 使用方法: cd /etc/ ...
- 程序自动分析(NOI2015)(洛谷P1955)题解
原题: 在实现程序自动分析的过程中,常常需要判定一些约束条件是否能被同时满足. 考虑一个约束满足问题的简化版本:假设x1,x2,x3...代表程序中出现的变量,给定n个形如xi=xj或xi≠xj的变量 ...