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.

原文地址:https://www.cnblogs.com/AlexanderZhao/p/12878884.html