SELECT
date,
avg(s_value) over (ORDER BY date ASC) -- 累计平均值
FROM
(
sum(plan_hours) AS s_value
tablename
GROUP BY
date
) m
————————————————————————————
写sql如下
select date,sum(plan_hours)/count(distinct gap_number) as a from 表
group by date