ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema

来源:互联网 发布:电脑印章的软件 编辑:程序博客网 时间:2024/06/05 04:59

今天打开 navicat运行一个update语句时,出现已经update成功,但是会报如下错误:

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

在网上找了好久的办法,特此记录。
第一步、打开查询界面输入select语句:

select version(), @@sql_mode;

第二步、在输入如下语句:

SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

第三步、重新执行update语句

update *** set ***=XXX where id=***

这样就可以解决问题了,亲测有效。但是我还不是很理解这样操作的原因,找到一篇相应的文章,用来参考。
http://blog.csdn.net/u014520745/article/details/76056170

阅读全文
0 0
原创粉丝点击