CONNECT BY PRIOR
693241Jan 3 2011 — edited May 25 2011Hello All ,
My oracle version is oracle 9i.
I have a table check with data as below ,
id parent id level
*1 2 1*
*2 3 2*
*3 4 3*
*1 5 1*
*5 6 2*
*6 7 3*
*7 8 4*
I want table output which traces through each end of node before it starts a new leaf like the output below ,
OUTPUT :
id level
1 1
2 2
3 3
5 2
6 3
7 4
8 5
How do i achieve this . Some how if i use connect by prior i have to use it like,
select proc_name from check
connect by prior
parent_id = id
and
connect by prior
lvl = (lvl-1);
which is not supported in oracle ,
so Is there anyother way in which i achieve the above output.
Thanks
vijay G