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 ...
随机推荐
- The processing instruction target matching "[xX][mM][lL]" is not allowed.
现象: ERROR : The processing instruction target matching "[xX][mM][lL]" is not allowed. 异 ...
- 【App】Android Studio 海马玩
一.工程创建及配置 1.gradle环境变量 2.首次创建工程慢:https://www.cnblogs.com/xiadewang/p/7820377.html 二.海马玩虚拟机 C:\Users\ ...
- java基础---->String中的split方法的原理
这里面主要介绍一下关于String类中的split方法的使用以及原理. split函数的说明 split函数java docs的说明: When there is a positive-width m ...
- IntelliJ IDEA 改变默认的签名 Administrator
/** * Created with IntelliJ IDEA. * User: Administrator * Date: 12-8-27 * Time: 下午11:29 * To change ...
- MySQL查询表与表字段的信息
环境: Mysql数据库 库名:db_name 表名: table_name1 table_name2 查询一个里面所有表的信息: use information_scheam; select * f ...
- PE、ELF结构图
PE:https://bbs.pediy.com/thread-203563.htm ELF:https://blog.csdn.net/jiangwei0910410003/article/deta ...
- phpStudy apache 启动不了
做 phpstudy 环境配置的时候,apache 一直启动不了,启动后又停止,80 端口也没有被占用,也下载了 vc9 运行库,还是不行,后来找了半天,中文路径的问题
- laravel+阿里大于实现发送验证码短信
一.短信服务使用阿里大于提供的短信接口 阿里大于官方网站上的接入流程: 在阿里大于申请接口后,需要做以下操作: 申请签名 申请短信模板 创建Accesskey,可以通过权限最大的Accesskey创建 ...
- jsp标签jstl和el表达式
1.el表达式的使用 1)访问bean的属性 方式一: ${user.name},容器会依次从pageContext,request,session,application中查找(getAttribu ...
- CString数组和CStringArray
CStringArray是编译器定义的类型!可以进行一些(如:访问.增.删.改)等操作. 集中单个字符串的操作使用Cstring,集中一批字符串的管理使用CstringArray. 一个是动态,CSt ...