mysql查询报错: ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
来源:互联网 发布:手机网络gsm cdma lte 编辑:程序博客网 时间:2024/06/07 02:44
在用mysql执行如下查询的时候:
- 1
报错信息如下:
- 1
错误的原因是我mysql版本是5.7的,使用如下语句查询可知
- 1
里面默认设置了
- 1
only_full_group_by
:使用这个就是使用和oracle一样的group 规则, select的列都要在group中,或者本身是聚合列(SUM,AVG,MAX,MIN) 才行,其实这个配置目前个人感觉和distinct差不多的,所以去掉就好
直接修改mysql配置文件(我的系统是Ubuntu16.04的,在/etc/mysql/mysql.conf.d/mysqld.cnf
中并没有sql_mode这个配置,所以直接加上就好,如果是其他系统有得修改就不用添加了)
[mysqld]下
- 1
到此mysql配置文件的完整配置如下:
阅读全文
0 0
- mysql查询报错: ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
- mysql查询报错: ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
- MySQL分组查询时出现错误SELECT list is not in GROUP BY ;this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- ERROR 1055 (42000): Expression #1 of ORDER BY clause is not in GROUP BY..sql_mode=only_full_group_by
- this is incompatible with sql_mode=only_full_group_by
- this is incompatible with sql_mode=only_full_group_by
- this is incompatible with sql_mode=only_full_group_by
- MySQL Error this is incompatible with sql_mode=only_full_group_by
- VSCode自定义快捷键运行插件命令(为插件设置自定义快捷键)
- Java对象与json对象之间的转换
- 137
- Linux内核抢占机制(preempt)
- 24 exdata架构探讨--优化主题系列
- mysql查询报错: ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
- Linux free命令使用及解析
- vue webpack环境搭建
- C语言指针基础预习
- python之导入os
- 计蒜客 跳跃游戏二
- RxJava 中的map与flatMap
- Java时间串获取
- python 爬虫