执行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的更多相关文章

  1. 最近升级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 ...

  2. Mysql更新关联子查询报错

    报错内容:sql  1093 - You can't specify target table 'u' for update in FROM clause 错误原因: if you're doing ...

  3. 解决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 ...

  4. MySQL查询报错 ERROR: No query specified

    今天1网友,查询报错ERROR: No query specified,随后它发来截图. root case:查询语法错误 \G后面不能再加分号;,由于\G在功能上等同于;,假设加了分号,那么就是;; ...

  5. 【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 ...

  6. 解决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 ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. java相对路径、绝对路径及类路径

    import java.io.File; import java.net.URL; /** * java相对路径.绝对路径及类路径的测试 */ public class Test { /** * 测试 ...

  2. CentOS 7下安装samba

    Samba是一种软件,它可以运行在非Windows平台上,比如UNIX, Linux, IBM System 390, OpenVMS或其他操作系统.Samba使用安装在主机上的TCP/IP协议.当正 ...

  3. iOS 调试大法

    本文转载至 http://www.jianshu.com/p/d19e19a91071 0.笨办法 看变量.对象?NSLog+重新编译运行:改某对象?改源码+重新编译运行:隔离某个方法?在方法中写 r ...

  4. cc攻击和ddos攻击

    DoS攻击.CC攻击的攻击方式和防御方法 DDoS介绍 DDoS是英文Distributed Denial of Service的缩写,意即“分布式拒绝服务”,那么什么又是拒绝服务(Denial of ...

  5. 【CF961G】Partitions 第二类斯特林数

    [CF961G]Partitions 题意:给出n个物品,每个物品有一个权值$w_i$,定义一个集合$S$的权值为$W(S)=|S|\sum\limits_{x\in S} w_x$,定义一个划分的权 ...

  6. java代码理解

    public int maxProfit(int k, int[] prices) {            int pl = prices.length;            int nothin ...

  7. Go语言基础之数据类型

    Go语言基础之数据类型 Go语言中有丰富的数据类型,除了基本的整型.浮点型.布尔型.字符串外,还有数组.切片.结构体.函数.map.通道(channel)等.Go 语言的基本类型和其他语言大同小异. ...

  8. 【持续集成】GIT+jenkins+sonar——GIT

    一.GIT基础 1.1 git简介 linus用C语言编写 2005年诞生 分布式管理系统 速度快.适合大规模.跨地区多人协同开发 1.2 本地管理.集中式.分布式 1.3 git安装 #CentOS ...

  9. 东大oj1155 等凹函数

    Problem Description 定义一种数字称为等凹数字,即从高位到低位,每一位的数字先递减再递增,且该数是一个回文数,即从左读到右与从右读到左是一样的,仅形成一个等凹峰,如543212345 ...

  10. uploadify 火狐 http error:302

    网上查询了一都说是flash 中 Session问题 (IE会自动复制过去),大多说将session值传过去就可以了但我们用的是公司的一套权限,改不了用户登录信息 无奈只好不用用户信息来做,果然对了 ...