首页 > 数据库技术 > 详细

mysql多表联合查询 [Err] 1055 - Expression #1 of SELECT list is not in GROUP BY clause this is incompatible with sql_mode=only_full_group_by

时间:2021-06-02 15:25:11      阅读:21      评论:0      收藏:0      [点我收藏+]
在 mysql进行 多表联合查询, 出现以下错误:

[Err] 1055 - Expression #1 of SELECT list is not in GROUP BY clause
which is not functionally dependent on columns in GROUP BY clause; 
this is incompatible with sql_mode=only_full_group_by

在终端 vim /etc/mysql/my.cnf, 按 i  进入插入模式.

在 [mysqld] 下面添加:

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

然后 按 esc,  输入 :wq 保存.

输入以下命令重启MySQL:  systemctl restart mysqld

然后再尝试执行多表联合查询的语句, 可以正常查询.

mysql多表联合查询 [Err] 1055 - Expression #1 of SELECT list is not in GROUP BY clause this is incompatible with sql_mode=only_full_group_by

原文:https://www.cnblogs.com/levia/p/14840713.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!