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!

Self Join Query on Table with Hierarchical Data

Naveen BOct 24 2013 — edited Oct 24 2013

I have an Oracle 11 based table containing hierarchical data in the following format.

CHILD, PARENT, CHILD_TYPE, PARENT_TYPE

Gessner Dr, Harris, Sreet, County

Memorial Dr, Harris, Street, County

Harris, Texas, County, State

Texas, US, State, Country

I require an SQL that will output as follows:

Level1, Level2, Level3, Level4, Level1_Type, Level2_Type, Level3_Type, Level4_Type

US, Texas, Harris, Memorial Dr, Country, State, County, Street

US, Texas, Harris, Gessner Dr, Country, State, County, Street

Any help will be appreciated.

Thanks,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2013
Added on Oct 24 2013
8 comments
1,875 views