create table tb(depart int,dt varchar2(10),score int) as
select department,to_char(data,'yyyy')+to_char(data,'mm') as dt,sum(score) as score
from tb group by department,to_char(data,'yyyy')+to_char(data,'mm') ;
select depart,dt,(select sum(score) from tb where depart=a.depart and dt<=a.dt) as score
from tb a;