报错信息:

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. R语言回归、anova方差分析、相关性分析 《精品购物指南》调研数据可视化|附代码数据

    全文链接:http://tecdat.cn/?p=30990 最近我们被客户要求撰写关于回归.anova方差分析.相关性分析的研究报告,包括一些图形和统计输出. 在分析时,我们向客户演示了用R语言回归 ...

  2. zabbix中文显示乱码解决

    问题zabbix使用中文显示,"监测-->图形"查看资源使用情况时会有乱码 解决问题1.修改配置文件(文件位置:$zabbix_path/include/defines.in ...

  3. sql使用!=查询时会忽略null数据

    table_a有3条数据 column1值分别为1,0,null 那么 select * from table_a where column1!='1' 只会查到clumn1为0的数据,null的数据 ...

  4. Django Rest Frame work 如何使用serializers序列化函数新手教程

    Django Rest Frame work 如何使用serializers序列化       Django Rest Framework提供了serializers模块,用于序列化和反序列化模型实例 ...

  5. 从COM域名即将涨价看如何控制域名成本问题

    我们很多站长在上周的时候应该陆续有收到各大域名注册商的推送邮件,将会在今年9月1日开始COM域名会涨价,当然涨价的福利也不是很大.标价大约是会到每个每年增加至9.99美元.可能我们有一些网友要说,有些 ...

  6. geoserver官网

    https://www.osgeo.cn/geoserver-user-manual/index.html

  7. Linux出现Read-only file system错误解决方法

    执行命令时遇到如下错误 这个问题是文件系统受损导致得,fstab文件未正确配置 解决方法: df -hT #查看一下分区及挂载信息 fsck -a /dev/sda3 -a :检查文件系统,有异常便自 ...

  8. oracle的ASM扩容

    #查看服务器上总共有多少个asmdisk [grid@rkdb1]$ asmcmd lsdsk --discovery Path /dev/oracleasm/disks/OCPDATA1 /dev/ ...

  9. px、em、rem的区别css单位换算

    在对页面进行自适应时,查阅相关资料了解到,通常有两种方式将px转换为em或者rem,下面就上述三者之间的联系进行讲解: em与px转换 一般浏览器默认1em=16px,通过设置font-size大小来 ...

  10. gRPC中protobuff type和C# type原生标量对应表

    查看Microsoft官方文档: Create Protobuf messages for .NET apps | Microsoft Docs