mysql数据库执行查询遇到 Expression #2 of SELECT list is not in GROUP BY的问题
Sonny_w的博客通过本文主要向大家介绍了Expression #2 of SEL,mysql,数据库等相关知识,希望本文的分享对您有所帮助
只要执行sql语句,就会抛出错误:
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column。。。
which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by;
这个sql语句违背了sql_mode=only_full_group_by 。
解决办法:
在登入mysql后,执行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";
就可以将问题处理,但是重启计算机后还是会有这个错误。尚未解决
先mark一下。