mysql出现GROUP BY clause错误解决办法

时间:2017-10-09 14:15:08   收藏:0   阅读:1461

#1)当mysql数据库出现如下错误:
#which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

#2)解决办法
#修改sql_mode
#查看sql_mode
select @@sql_mode,@@global.sql_mode;

#去掉ONLY_FULL_GROUP_BY
set @@global.sql_mode =‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION‘;
set @@sql_mode =‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION‘;

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!