I have two tables, the first (T1) is a base number, the first is a base value per symbol:
symbol value
------------ -----
ABC 1000
DEF 2000
The second table (T2) s a series of values per date, i.e.:
date symbol value
---------- ------ -----
2011-09-01 ABC 100
2011-09-02 ABC 10
2011-09-03 ABC 1
What query would I require to get the accumulated total of the value column added to the initial value in the first column over the several days. So the output of the query would look something like
symbol date total
------ ---------- ------
ABC 2011-09-01 1100
ABC 2011-09-02 1110
ABC 2011-09-03 1111
So its the sum of the inital value in T1 plus the sum of all dates less than the date in that column.
The target database for this is DB2 on iSeries
An SQL approach