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 GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by mysql 5.7之后,查询如下:
select @@sql_mode;
如果:ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
默认设置了:
sql_mode=only_full_group_by
only_full_group_by:使用它就和oracle一样的group规则,select的列都要在group中,或本身就是聚合列(sum,avg,max,min)才行,只要把它去掉即可。
处理方法:直接在Mysql配置文件中修改(没有就增加)
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
mysql(5.7以上)查询报错:ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by的更多相关文章
- 最近升级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更新关联子查询报错
报错内容:sql 1093 - You can't specify target table 'u' for update in FROM clause 错误原因: if you're doing ...
- 解决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 ...
- MySQL查询报错 ERROR: No query specified
今天1网友,查询报错ERROR: No query specified,随后它发来截图. root case:查询语法错误 \G后面不能再加分号;,由于\G在功能上等同于;,假设加了分号,那么就是;; ...
- 【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 ...
- 解决mysql报错:- Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ'
mysql执行报错: - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c ...
- myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL se ...
- mysql 5.7 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ...报错
使用mysql在执行一条插入语句时 , ', "hhh"); 报错:Expression #1 of ORDER BY clause is not in GROUP BY clau ...
- windows server 2008 安装MySQL 8.0 遇到报错 1055 - Expression #1 of ORDER BY clause is not in GROUP BY
mysql安装参考教程:https://blog.csdn.net/qq_37350706/article/details/81707862 安装完毕后 执行sql语句 SELECT * FROM c ...
随机推荐
- go与c语言的互操作
https://tonybai.com/2012/09/26/interoperability-between-go-and-c/ https://tonybai.com/2016/02/21/som ...
- [原]win10下编译lua5.3.4
1.下载lua源码http://www.lua.org/ftp/ 2.打开vs2012工具命令提示 3.cd 到lua源码的src目录 4.依次执行以下代码 cl /MD /O2 /c /DLUA_B ...
- WEB服务器与应用服务器的区别
一.简述 WEB服务器与应用服务器的区别: 1.WEB服务器: 理解WEB服务器,首先要理解什么是WEB?WEB可以简单理解为我们所看到的HTML页面就是WEB的数据元素,处理这些数据元素的应用软件就 ...
- linux 系统全盘备份
备份程序对比 - Synchronization and backup programs 之前用的 tar进行备份了,更新 grub引导需要重建目录和手动挂载,不是很方便.现直接使用 timeshif ...
- gnome-shell 扩展
application menu topicons plus dash to dock native window placement netspeed no topleft hot corner o ...
- Jquery 获取 radio选中值,select选中值
随着Jquery的作用越来越大,使用的朋友也越来越多.在Web中,由于CheckBox.Radiobutton .DropDownList等控件使用的频率比较高,就关系到这些控件在Jquery中的操作 ...
- 4 html文件引用问题
通常在写html文件的时候会遇到需要引入样式文件,或者图片等问题,对于有一定开发经验的人来说,这些都不是问题,做为初学者,还是有必要理解html文件引用的“思路”的 当html文件和要引用的文件在同一 ...
- web项目访问地址前添加小图片
修改HTML 1.head标签添加 <link rel="icon" type="image/x-icon" href="images/icon ...
- javascript的数组之filter()
filter()方法创建一个新数组,其包含通过回调函数测试的所有元素. const words = ['spray', 'limit', 'elite', 'exuberant', 'destruct ...
- Luogu 1068 - 分数线划定 - [快速排序]
题目链接:https://www.luogu.org/problemnew/show/P1068 题目描述世博会志愿者的选拔工作正在 A 市如火如荼的进行.为了选拔最合适的人才,A 市对所有报名的选手 ...