P
papaja
Hello,
My table has 2 columns with some numbers:
col1 col2
---------------
5 0
0 5
0 10
2 0
8 0
I need a query for web page that will produce dataset with 5 columns:
col1 col2 cumulativeSumCol1
cumulativeSumCol2 diff
-------------------------------------------------------------------------------------
5 0 5
0 5
0 5 5
5 0
0 10 5
15 -10
2 0 7
15 -8
8 0 15
15 0
....
cumulativeSumCol1 holds in each row sum of all values from col1's
previous rows. Example: in Row no. 5 cumulativeSumCol1 holds sum of
first 4 rows from col1. This is the same for cumulativeSumCol2.
Diff is difference between cumulativeSumCol1& cumulativeSumCol2.
How to acomplish this?
My table has 2 columns with some numbers:
col1 col2
---------------
5 0
0 5
0 10
2 0
8 0
I need a query for web page that will produce dataset with 5 columns:
col1 col2 cumulativeSumCol1
cumulativeSumCol2 diff
-------------------------------------------------------------------------------------
5 0 5
0 5
0 5 5
5 0
0 10 5
15 -10
2 0 7
15 -8
8 0 15
15 0
....
cumulativeSumCol1 holds in each row sum of all values from col1's
previous rows. Example: in Row no. 5 cumulativeSumCol1 holds sum of
first 4 rows from col1. This is the same for cumulativeSumCol2.
Diff is difference between cumulativeSumCol1& cumulativeSumCol2.
How to acomplish this?