Cummulative
Hi ,
I have a requirement where i have a table
<pre>
itemno ssitem value
IA1 IB1 5
IB1 IC1 2
IC1 NULL 1
ID1 NULL 3
IF1 IK1 5
IK1 NULL 1
</pre>
I need the cummulative values ,here itemno and ssitem has parent child relation .
For IC1(itemno) chain is like (IC1(itemno)>IC1(ssitem)>IB1(itemno))>IB1(SSITEM)>IA1(itemno)
so we have add all the values and show the value for IC1(itemno) as 8
For ID1(itemno) chain is not there so we will show just the corresponding value i.e 3
For Ik1(itemno) chain is (IK1(ssitem)>IF1(itemno)) so some of two records so 6
<pre>
itemno ssitem value cummulative
IA1 IB1 5 NULL
IB1 IC1 2 NULL
IC1 NULL 1 8
ID1 NULL 3 3
IF1 IK1 5 NULL
IK1 NULL 1 6
</pre>
Please help me out
Thanks