mysql 报错 incompatible with only_full_group_by
来源:互联网 发布:怎么使用淘宝客推广 编辑:程序博客网 时间:2024/05/20 23:56
mysql报错:
Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'crm.mtt_profit.PROFIT' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
mysql 版本: 5.7.x
修复办法:
sudo vim /etc/my.cnf #(根据实际修改配置文件)#添加下面的配置:[mysql]sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONsudo service mysql restart
或者每次查询之前,先运行 sql:
set SESSION sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
开启了 only_full_group_by 意味着你只能 select group by 的那个字段 或者使用 MIN() MAX() 等聚合的其它字段
当然你也可以规范你的 sql查询语句,保持默认配置。
阅读全文
1 0
- mysql 报错 incompatible with 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
- [mysql] 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查询报错: ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
- mysql5.7.9报错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
- mysql 5.7 this is incompatible with sql_mode=only_full_group_by 问题
- Lucene7.1.0学习
- 数据蒋堂 | JOIN提速
- PowerDesigner逆向工程导出oracle表结构 若干问题
- python学习总结---lambda匿名函数
- three.js之投影矩阵
- mysql 报错 incompatible with only_full_group_by
- BZOJ2597: [Wc2007]剪刀石头布(费用流)
- 初识View-THREE
- WebP使用 图片优化
- ASP.NET基于NPOI导出数据
- es-04
- Java线程之守护线程(Daemon)
- Spring Cloud 前后端分离后引起的跨域访问解决方案
- 生成vue模板