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!

connect by and display both parent and child name

dba94403Nov 18 2015 — edited Nov 18 2015

I have a table that has ID, Name, ParentID columns.  I have this query to show the ParentID|ID relationship.

select ParentID, ID from t1

connect by prior ID = ParentID;

Now I want to get the name of the parent and child for each record.  So the output would be ParentID|ParentName|ID|ChildName.  How would I modify the query to do this.  Thanks much.

This post has been answered by Solomon Yakobson on Nov 18 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 16 2015
Added on Nov 18 2015
11 comments
3,029 views