我已经解决了这个查询:
SELECT round(avg(total_kpi),2) as avg_kpi,
case when avg(total_kpi) < 3 then 'NEG'
when avg(total_kpi)>3 then 'POS' end as kpi,
count(gender) as gender,
gender,
round(avg(locacion),2) as avg_locacion,
round(avg(tiempo),2) as avg_tiempo,
round(avg(servicio),2) as avg_servicio,
round(avg(calidad),2) as avg_calidad
FROM datellig_ift.a02_view_kpi_2
WHERE id_man_medicion=4
group by
case when avg(total_kpi) < 3 then 'NEG'
when avg(total_kpi) > 3 then 'POS' end
我需要按第 2 列对数据进行分组。分组时,mysql 拒绝。
抱歉,我一直在看一些帖子,但不明白为什么不起作用。谢谢。
错误信息:
#1111 - 组功能的使用无效