–select * from tmn_zhbg order by id desc

select id, mc,fs,class,sum (fs) over (order by fs,id) 连续累加,sum (fs) over (order by fs) 连续累加XX,sum (fs) over (partition by id ) 分组求和,
sum (fs) over (partition by id order by fs ) 分组id连续
from
(
select 1 id,’yw’ mc,50 fs,1 class from dual
union all
select 1 , ‘sx’ , 81,1 from dual
union all
select 1 , ‘yy’ , 20,1 from dual
union all
select 2 , ‘yw’ , 81,1 from dual
union all
select 2 , ‘sx’ , 32,1 from dual
union all
select 2 , ‘yy’ , 21,1 from dual
union all
select 4 , ‘yw’ , 10,1 from dual
union all
select 4 , ‘sx’ , 82,1 from dual
union all
select 4 , ‘yy’ , 20,1 from dual
) a