#1055-SELECT列表的表达式不在GROUP BY子句中,并且包含未聚合的列,这与sql_mode = only_full_group_by不兼容 [英] #1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this is incompatible with sql_mode=only_full_group_by
本文介绍了#1055-SELECT列表的表达式不在GROUP BY子句中,并且包含未聚合的列,这与sql_mode = only_full_group_by不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的查询:
select libelle,credit_initial,disponible_v,sum(montant) as montant
FROM fiche,annee,type where type.id_type=annee.id_type and annee.id_annee=fiche.id_annee
and annee = year(current_timestamp) GROUP BY libelle order by libelle asc
- Mysql 5.7.9运行查询没有问题,但mysql 5.7.12 显示上面的错误,请您帮我
- Mysql 5.7.9 runs the query without any problem but mysql 5.7.12 display the error above Could you please help me with that
-
sudo vim /etc/mysql/conf.d/mysql.cnf
-
滚动到文件底部,复制并粘贴
sudo vim /etc/mysql/conf.d/mysql.cnf
Scroll to the bottom of file Copy and paste
- 保存并退出输入模式
-
sudo service mysql restart
重新启动MySQL. - save and exit input mode
sudo service mysql restart
to restart MySQL.
推荐答案
我为此进行了艰苦的工作,我对其进行了测试,并且在lamp服务器mysql版本5.12上可以正常工作
I had a struggle getting this to work i've tested it and it's working on lamp server mysql version 5.12
因此,成功的步骤:
[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
[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
到文件底部
完成!
这篇关于#1055-SELECT列表的表达式不在GROUP BY子句中,并且包含未聚合的列,这与sql_mode = only_full_group_by不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文