Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'jira.ji.ID' which is not functionally dependent on columns in GROUP BY clause;only_full_group_by

发布时间 2023-10-18 11:31:40作者: 不忘初心2021

这个报错的完整信息

Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'jira.ji.ID' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

  这个说的意思是你使用id需要分组,本次方案针对我自己的问题

我是将sql语句放到永洪报表才出现的,在永洪报表中ji.id和ji.`ID`是不一样的情况,有的时候,你使用聚合函数,比如sum(aa.c),那个作为

返回值的时候,请这个sum(aa.c) as 'count',这个可以避免提示分组的情况,我的sql是统一为ji.id,然后最后 group by ji.id