报错信息:

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. 安装最新版cmake

    pip install cmake --upgradewhich cmakeln -s $(which cmake) /usr/local/bin/cmake

  2. Characterizing possible failure modes in physics-informed neural network

    NeurIPS 2021 表征PINN中可能的失败模式.本文的思路也比较简单,通过对PINN的优化域进行观察,发现导致PINN训练的原因并不是因为神经网络的表达力不足,而是由于PINN中引入了基于PD ...

  3. Skywalking安装

    https://www.cnblogs.com/duanxz/p/15602842.html

  4. 富文本编辑器转word

    https://blog.csdn.net/qq_41532872/article/details/108644773

  5. gin websocket

    gin 中使用websocket功能 go get github.com/gorilla/websocket var upgrader = websocket.Upgrader{ CheckOrigi ...

  6. 远程CG动画制作的神器:RayLink远程控制软件

    近几年疫情变幻多端,加上数字经济的快速发展,直接助推各行各业信息化发展.越来越多企业打破传统固定办公室的限制,对工作场所的选择愈加灵活.自由化.诸如居家办公.外地出差办公.会议协同办公等远程办公的应用 ...

  7. Xpath 常用语法展示

    非标准代码处理 from lxml import etree #导入lxml 中erree模块 parser = etree.HTMLParser(encoding="utf-8" ...

  8. Spark之详解及性能优化

    一.spark简介 Apache Spark是一个围绕速度.易用性和复杂分析构建的大数据处理框架. Spark是用Scala程序设计语言编写而成,运行于Java虚拟机(JVM)环境之上.目前支持如下程 ...

  9. 手把手教你用Typora自动上传到picgo图床【教程与排坑】

    手把手教你用Typora自动上传到picgo图床[教程与排坑] 参考链接: 1. https://blog.csdn.net/disILLL/article/details/104944710?utm ...

  10. DDD(二)聚合、聚合根、领域服务、应用服务、仓储”和“工作单元”、领域事件、集成事件

    DDD(二)聚合.聚合根.领域服务.应用服务.仓储"和"工作单元".领域事件.集成事件 如果觉得样式不好:跳转即可 http://www.lifengying.site/ ...