接:this is incompatible with sql_mode=only_full_group_by

错误:mysqliError:Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'XXXXX' 
which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
原因:输出的结果是叫target list,就是select后面跟着的字段,还有一个地方group by column,就是group by后面跟着的字段。由于开启了ONLY_FULL_GROUP_BY的设置,
所以如果一个字段没有在target list和group by字段中同时出现,或者是聚合函数的值的话,那么这条sql查询是被mysql认为非法的,会报错误。

原文链接:https://blog.csdn.net/qq_42175986/java/article/details/82384160

原文链接:https://blog.csdn.net/wxyf2018/article/details/99756962

解决(2):出现这个错误说明写的sql语句不够严谨,输出的结果很可能不是你想要的,建议优化sql
原文地址:https://www.cnblogs.com/kousum/p/14282550.html