报错信息:

Expression #1 of SELECT list is not in GROUP BY clause and contains 
nonaggregated column ‘a.rsc_adj_no’ which is not functionally 
dependent on columns in GROUP BY clause; this is incompatible with 
sql_mode=only_full_group_by

选择列表中的一个不在GROUP BY子句中,它包含非聚合列“ rsc_adj_no ”,在功能上不存在依赖于GROUP BY子句中的列。这与sql_mode = only_full_group_by相悖

解决方法:

1. select @@global.sql_mode; 查询结果若包括ONLY_FULL_GROUP_BY,使用 set @@global.sql_mode="xxxx";  (去掉ONLY_FULL_GROUP_BY的其他字符串)重新设置即可

2. 修改my.cnf 文件后,重启mysql

[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

3. 使用函数any_value把报错的字段name包含起来。如,

  select any_value(rsc_adj_no) rsc_adj_no,any_value(bill_no) bill_no from table group by bill_no;

Expression #1 of SELECT list is not in GROUP BY clause and contains nonag的更多相关文章

  1. [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 ...

  2. 【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 ...

  3. 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 ...

  4. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre

    原文链接:https://blog.csdn.net/hq091117/article/details/79065199 https://blog.csdn.net/allen_tsang/artic ...

  5. 记录一次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 ...

  6. mySql中Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题

    报错信息 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'a.id' ...

  7. 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 'rpa ...

  8. 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 ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. system verilog与C语言的接口(包含使用方法以及实例)

    资料来源 (1) sv绿皮书; (2) vcs user guide; (3) https://www.cnblogs.com/studyforever/p/5169243.html (4) syst ...

  2. 安装使用反编译工具ILSPY

    一.ILSPY简介1.1.ILSPY介绍 ILSPY是一款开源.免费的.且适用于.NET平台反编译[C#语言编写的程序和库(.dll)内容]工具:可以集成在Visual Studio 开发工具中,能够 ...

  3. 从零搭建hadoop集群之mysql安装

    Linux RPM 方式安装 MySQL在 hadoop02机器上 1. 安装新版mysql前,需将系统自带的mariadb-lib卸载 [root@hadoop02 ~]# rpm -qa|grep ...

  4. v3.x compoistion api 是什么

    在Vue 2.x的基础上要解决的问题: 1. 更低成本的达到逻辑复用(mix in :混入,找不着,命名冲突) 2. 代码组织 3. 类型推导更稳定 目标:使得Vue在大型应用中更有竞争力.

  5. vue调接口导出表格

     props:{       form:{         type:Object,         default:()=>{}       },       indexNum:{       ...

  6. 用字典代替'if-elif-else'

    在实际应用中,我们经常会需要采用if-elif-else控制语句以根据不同条件,作出不同的操作.if-elif-else固然可以,但是它也存在冗余的缺点,特别是当条件较多时这一缺点尤为明显.因此,本文 ...

  7. zabbix监控网络断网情况--初级版

    zabbix初级监控,通过IMCP方式PING即可 添加网络网关IP地址,鉴于zabbix一般报警方式采取发送邮件.钉钉.微信报警需要网络环境支持,于是至少设置zabbix服务器双网通,建议有条件上三 ...

  8. uni-app使用阿里巴巴图标库icon详细步骤--避免踩坑

    踩了很多坑~~  最终终于找到可以使用阿里图标库的方法  简单方便 阿里巴巴图标库:https://www.iconfont.cn/home/index?spm=a313x.7781069.19989 ...

  9. chrome 请停用以开发者

    链接:https://pan.baidu.com/s/1YhWINGlUVyTE5XyBVIGW_Q 提取码:23t2 转载至   https://www.cnblogs.com/it-tsz/p/9 ...

  10. python调用lua脚本

    目录 lua代码 python代码 lua代码 入口函数是必须要填的 function test1(params) return 'test1:'..params end function test2 ...