create or replace view sumproinvview
(guid, proguid, prono, proname, proclass, process, auditmoney, year, month, moninv, suminv, sumpercent)
as
select guid,proguid,prono,proname,proclass,process,auditmoney,year,month,sumInv,
sum(sumInv) over(partition by proguid order by month), sum(sumPercent) over(partition by proguid order by month)
from proInvview pd;
以上sql 可根据 月份来 进行 分月统计,即截止到 该月为止的总数目
oracle 用over进行累计计算
最新推荐文章于 2023-02-09 18:43:05 发布