您的位置:首页 > 大数据 > 人工智能

#1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this i

2017-01-11 11:01 1466 查看
这个sql语句违背了sql_mode=only_full_group_by 。

先看看这个sql_mode=only_full_group_by是个什么意思:

(摘自官网文档)

来源链接:
http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_only_full_group_by
MySQL Handling of GROUP BY

解决办法:

去掉ONLY_FULL_GROUP_BY即可正常执行sql.

sudo
vim /etc/mysql/conf.d/mysql.cnf


Scroll to the bottom of file Copy and paste
[mysqld]sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION


to the bottom of the file

save and exit input mode

sudo
service mysql restart
 to restart MySQL.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐