最近升级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[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'user_link.group_id' which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by- The SQL being executed was: SELECT * FROM `user_link` WHERE `group_id` IN ('78', '79') GROUP BY `link_id`
执行查看:select @@sql_mode;
里面默认设置了:sql_mode=only_full_group_by
only_full_group_by
:使用这个就是使用和oracle一样的group 规则, select的列都要在group中,或者本身是聚合列(SUM,AVG,MAX,MIN) 才行,其实这个配置目前个人感觉和distinct差不多的,所以去掉就好
或者修改sql语句
最近升级mysql5.7出现下面问题,ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by的更多相关文章
- mysql(5.7以上)查询报错:ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
执行mysql命令查询时: select * from table_name错误信息如: [Err] 1055 - Expression #1 of ORDER BY clause is not in ...
- MySQL5.7.27报错[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated
mysql5.7.27在运行更新语句时出现如下情况,mysql5.6之前没有这种情况出现. of ORDER BY clause is not in GROUP BY clause and conta ...
- mysql5.7执行sql语句提示Expression #1 of ORDER BY clause is not in GROUP BY
mysql 新版本出现group by 语句不兼容问题 [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause ...
- mysql错误:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated
今天迁移django数据库的时候,跑程序的时候出现这样的错误: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY cla ...
- 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contai
之前一直使用的mysql5,突然换成8之后,有许多地方不一样,今天就碰到一个. 在使用sql语句创建表时,报错: 1055 - Expression #1 of ORDER BY clause is ...
- MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause
MySQL[Err]1055 上次MySQL5.7.19主从建立完成之后,所有的测试都是在MySQL命令行下进行的,最近用Navicat Premium进行MySQL的连接,然后在插入数据的时候MyS ...
- 解决MySQL报错:1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'informat
解决MySQL报错:1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'informat ...
- navicat:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and ...
mysql5.7,xshell下执行sql不会报下面的错,但是navicat会报错,可能是navicat版本问题,换其他客户端不会出现问题. [Err] 1055 - Expression #1 of ...
- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause 的问题 MySQL
问题:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregate ...
随机推荐
- 【BZOJ4236】JOIOJI [DP]
JOIOJI Time Limit: 10 Sec Memory Limit: 256 MB[Submit][Status][Discuss] Description JOIOJI桑是JOI君的叔叔 ...
- bzoj 2079: [Poi2010]Guilds——结论题
Description Zy皇帝面临一个严峻的问题,两个互相抵触的贸易团体,YYD工会和FSR工会,他们在同一时间请求在王国各个城市开办自己的办事处.这里有n个城市,其中有一些以双向马路相连,这两个工 ...
- 【NOIP】2013提高组 花匠(摆花)
[算法]DP||贪心 [题解] (1)动态规划: 令f[i][0..1]为两种条件下前i株花的最大保留数量,状态转移方程: f[i][0]=max(f[j][1]+1) (j=i-1...1)(h[i ...
- ios应用里面进入app store 下载界面
转自:http://blog.csdn.net/diyagoanyhacker/article/details/6654838 在IOS应用里直接打开app store 评论页面的方法: [[UIAp ...
- c++ 引用的分析
在一般教材里面,我们会说引用是变量的别名,另外在 c++ primer 5里面说到引用的时候,说引用不是对象,不能对它进行取地址.但是我们来看看下面代码的分析: #include <iostre ...
- docker基于本地模版导入创建镜像
/* 因为直接去网站拿会下载的慢,所以直接到网站里,对着此包--〉右键--〉复制链接地址 网站地址:https://openvz.org/Download/template/precreated */ ...
- FineReport——JS二次开发(自定义翻页按钮)
FR允许自定义工具栏上面的按钮,并提交JS方法: 对于翻页功能,大概有首页,下一页,上一页,最后一页,以及跳转页等功能. 不得不说的是,在HTML页面自定义的按钮如何获取到报表模板,通过FR提供的JS ...
- javascript方法--apply()
今天琢磨了一下apply,以前对这个方法觉得比较懵,今天一琢磨确实觉得挺好玩的. 一开始把MDN的apply文档看了一遍,感觉不是很理解,而且有一些东西也是知道但是比较模糊,所以还是一步一步来,不懂查 ...
- 其实linux下远程windows并不麻烦
1:如果你是安装的ubuntu.那么安装完成之后就自带一个Remmina的远程桌面工具 2:这里我们需要安装rdesktop和tsclient,其中rdesktop是基于命令行的工具,tsclient ...
- Leetcode 之Longest Valid Parentheses(39)
有一定的难度.用堆栈记录下所有左符的位置,用变量记录下孤立右符的位置. int longestValidParentheses(const string& s) { stack<int& ...