【发布时间】:2021-06-15 11:39:14
【问题描述】:
我遇到了 ORA-00937: "not a single-group group function" 这个 sql 查询的错误问题: 请有任何想法!谢谢。
SELECT avg(count(*)) as value, 'Taux remplissage' as serie, to_char(c.datcre, 'YYYY-MM-DD') as arg
from charge c left join emplac e ON c.adr = e.adr
where e.ADR is not null and e.empsta != 'I' and e.empsta != 'V'
and (trunc(c.datcre) >= to_date('2020-11-01','YYYY-MM-DD'))
and (trunc(c.datcre) <= to_date('2021-11-30','YYYY-MM-DD'))
GROUP BY to_char(c.datcre, 'YYYY-MM-DD')
ORDER BY arg, serie
【问题讨论】:
-
问题是
avg(count(*))。你能解释一下你想要完成什么吗? -
@GordonLinoff: 我想计算一个商店的填充率(平均值)
-
。 .我应该更清楚:在问题中提供样本数据、期望、结果和清晰的解释。