functionally专题

which is not functionally dependent on columns in GROUP BY clause 错误解决方法

今天遇到了which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by的错误,记录一下解决方法。 该错误是因为在SQL语句中用到了聚合函数,但是聚合函数之外的字段没有全部放到group by里面,解决办法有2种: 1