Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Cummulative

user11936261Jan 15 2010 — edited Jan 21 2010
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
This post has been answered by Karthick2003 on Jan 15 2010
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 18 2010
Added on Jan 15 2010
4 comments
1,236 views