which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mod

在执行查询时,报错:SELECT * FROM `ziyuan` GROUP BY `modular_id`;

解决办法:

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';

去掉ONLY_FULL_GROUP_BY即可正常执行sql.

发布了122 篇原创文章 · 获赞 21 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/xingkongtianyuzhao/article/details/102581521