Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Group by question...
select
max(decode(t1.MonthYear, t2.MonthYear, t1.Amount, 0)) Amount,
t2.MonthYear,
sum(t1.Amount) Amount
from Your_Table t1, Your_Table t2
where
t1.MonthYear<=t2.MonthYear
group by
t2.MonthYear
order by
t2.MonthYear
;
--
Alexander I.Doroshko, aid_at_grant.kharkov.ua