!!!sql_mode=only_full_group_by配置
Expression #7 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'invoicecertify.goods.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
问题:
select sum(goods.je) je,sum(goods.se) se, goods.hwmc hwmc,goods.zclx zclx ,goods.zcsq zcsq, invoice.state state
,goods.id id,invoice.ref_company_id ref_company_id
from in_goods_detail goods join in_invoice_certification invoice
on invoice.code = goods.code and invoice.number = goods.number
WHERE invoice.cert_state = 3
and (goods.zcsq is null or goods.zcsq = '2017-09')
and ref_company_id = 2107
group by invoice.state,goods.hwmc,goods.zclx,goods.zcsq
测试环境可以用,演示环境不可以用???select version() 不一致,sql_mode 不同
Database changed
mysql>
mysql> set @@GLOBAL.sql_mode='';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> set sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
Query OK, 0 rows affected (0.00 sec)
以下为copy:
mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
!!!sql_mode=only_full_group_by配置的更多相关文章
- 【Solution】MySQL 5.8 this is incompatible with sql_mode=only_full_group_by
[42000][1055] Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated colu ...
- MySQL查询语句报错 sql_mode=only_full_group_by 问题
升级MySQL到5.7后,查询语句总是报sql_mode=only_full_group_by问题,总结归纳了两种解决方案,推存第二种解决方案. 报错信息: [Err] 1055 - Expressi ...
- MySQL sql_mode=only_full_group_by错误
今天在测试服务器上突然出现了这么一个MySQL的问题,同样的代码正式服没有问题,那肯定就是出在了配置上,查了一下原因才明白原来是数据库版本为5.7以上的版本, 默认是开启了 only_full_gro ...
- Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: ..... this is incompatible with sql_mode=only_full_group_by
一.异常信息 org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysq ...
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
在mysql 工具 搜索或者插入数据时报下面错误: ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause ...
- 最近升级mysql5.7出现下面问题,ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
执行sql: SELECT * FROM `user_link` WHERE `group_id` IN ('78', '79') GROUP BY `link_id` 报错: SQLSTATE[42 ...
- MYSQL 版本5.7.24 sql_mode=only_full_group_by问题
具体出错提示: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggr ...
- mysql报错this is incompatible with sql_mode=only_full_group_by
1.报错信息 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP ...
- mysql5.7 this is incompatible with sql_mode=only_full_group_by错误
解决办法: https://blog.csdn.net/qq_42175986/article/details/82384160 前言: 一.原理层面 这个错误发生在mysql 5.7 版本及以上版本 ...
随机推荐
- HDU 2030 汉字统计
http://acm.hdu.edu.cn/showproblem.php?pid=2030 Problem Description 统计给定文本文件中汉字的个数. Input 输入文件首先包含一 ...
- docker cp 和docker exec 查看docker 运行的容器信息
1. 使用docker 运行 redis 和 postgresql docker run -d -p : -v /redis/data/:/data redis docker run -d -p : ...
- BZOJ2743 HEOI2012采花(离线+树状数组)
如果能够把所有区间内第二次出现某颜色的位置标记出来,树状数组查询一下就可以了. 考虑离线.按左端点从小到大排序,不断移动左端点并更新第二次出现的位置. #include<iostream> ...
- 【BZOJ1028】[JSOI2007]麻将(贪心)
[BZOJ1028][JSOI2007]麻将(贪心) 题面 BZOJ 洛谷 题解 感觉好久没打过麻将了,似乎都快不会打了. 这个数据范围看着就觉得是\(O(n^2m)\). 那么就枚举听哪张牌,然后枚 ...
- 洛谷 P4841 城市规划 解题报告
P4841 城市规划 题意 n个有标号点的简单(无重边无自环)无向连通图数目. 输入输出格式 输入格式: 仅一行一个整数\(n(\le 130000)\) 输出格式: 仅一行一个整数, 为方案数 \( ...
- c++桥接模式
可以简记为pointer to implement:”指向实现的指针”. [DP]书上定义:将抽象部分与它的实现部分分离,使它们都可以独立地变化.考虑装操作系统,有多种配置的计算机,同样也有多款操作系 ...
- python常用模块-配置文档模块(configparser)
python常用模块-配置文档模块(configparser) 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. ConfigParser模块用于生成和修改常见配置文档,当前模块的名称 ...
- timer.Interval用法简介
这个东东呢是我在做windows服务的时候碰到的,总结了一下她的用法,如下: 一.指定时间间隔 写一个每隔一分钟就执行一次的吧 public partial class PSJCService : S ...
- bzoj千题计划205:bzoj3529: [Sdoi2014]数表
http://www.lydsy.com/JudgeOnline/problem.php?id=3529 有一张n*m的数表,其第i行第j列(1 < =i < =n,1 < =j & ...
- CF&&CC百套计划4 Codeforces Round #276 (Div. 1) A. Bits
http://codeforces.com/contest/484/problem/A 题意: 询问[a,b]中二进制位1最多且最小的数 贪心,假设开始每一位都是1 从高位i开始枚举, 如果当前数&g ...