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!

Hierarchical Query without START WITH CONNECT BY

Kuldeep2Jun 27 2011 — edited Jun 27 2011
Hi

I have data like below (Hierarchical)

ID Name ParentID Level
1 AAA 1 0
2 BBB 1 1
3 CCC 2 2
4 DDD 1 0
5 EEE 4 1


I want to find out Level 0 of each leaf level. for example

If i give input ID as 3, I should get its Level 0 as ID 1, For ID 5, level 0 is 4.

I dont want to use START WITH CONNECT BY as i need to test this query against some other database for performance.

Can we do it without using any Oracle advanced function just by using simple joins.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 25 2011
Added on Jun 27 2011
5 comments
844 views