SQL 99 answer.
Re: Create a third row that make the sum of past row + current row (i.e. a running sum)?
Nearly the same but last column is current total + previous like :
week total t
1 5 5
2 6 11
3 5 16
[sql]
select t2.week, t2.total, sum(t1.total)
from MY_TABLE T1, MY_TABLE T2
where T1.WEEK <=t2.week
group by t2.week, T2.total
order by t2.week asc
[/sql]
|