1055-only_full_group_by 分组查询报错解决方案
来源:互联网 发布:伊吹级巡洋舰数据 编辑:程序博客网 时间:2024/05/22 06:12
方案1:修改mysql配置文件。
在配置文件my.cnf中关闭sql_mode=ONLY_FULL_GROUP_BY.。mysql的默认配置是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。可以把ONLY_FULL_GROUP_BY去掉,也可以去掉所有选项设置成sql_mode=,如果你确信其他选项不会造成影响的话。
方案2:在sql语句匹配不到的列加上any_value(字段名)。
如:select a.supid,any_value(b.phone) as phone,COUNT(a.phone) as chargenum from balance a left join sup_phone b on a.supid=b.supid WHERE starttime like #{datetime} GROUP BY a.supid
阅读全文
1 0
- 1055-only_full_group_by 分组查询报错解决方案
- sql_mode=only_full_group_by引起group by查询报错问题
- Mysql only_full_group_by以及其他关于sql_mode原因报错详细解决方案
- Mysql only_full_group_by以及其他关于sql_mode原因报错详细解决方案
- mysql 报错 incompatible with 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
- linux mysql5.7报err 1055错误 sql_mode=only_full_group_by
- MySQL 报错:5.7版本sql_mode=only_full_group_by问题
- laravel5.4 使用多字段查询分组报错
- MySQL 5.7 sql_mode设置 分组查询报错
- 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
- mysql5.7.9报错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
- springboot+thymeleaf 实现thymeleaf自定义方言系统 自定义标签, cms系统搭建(二)
- 小店开张
- python 常用函数收集
- IDEA自动编译设置
- Unity有限状态机
- 1055-only_full_group_by 分组查询报错解决方案
- [转]悬浮控件的实现
- Arcpy为本地数据按指定要求添加字段
- sqlserver 数据区间补全
- Cydia Substrate
- framework audio通路控制
- JS判断是否为IE浏览器
- 程序员的收藏夹
- 源代码管理工具介绍