Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Tree Query question
Hi,
have you tried something like
select
<parent>, sum(<spent>) from <table> connect by prior <job> = <parent> start with <job> = 10 group by <parent>
Just substitute the column names. You will get an answer on the query although I'm not sure it's the one you want.
Cheers,
>
>Data look something like this.
>
>Job Parent Spent
>10 NULL 100 -- top level has NULL parent WBS 10
>20 10 500 -- child 10.20
>27 20 700 -- grandchild 10.20.27
>32 27 50 -- great grandchild 10.20.27.32
>21 20 200 -- a 2nd branch from job 20 10.20.21
>
Kaboel Karso Received on Wed Nov 12 1997 - 00:00:00 CST
![]() |
![]() |