SQL 99 answer.
Re: Create a third row that make the sum of past row + current row (i.e. a running sum)?
The following feature outside Core SQL-99 is used:
T611, "Elementary OLAP operations"
(checked with the mimer sql validator)
[sql]
SELECT week
, total
, sum(total) over (order by week desc) as running_total
FROM my_table
[/sql]
|