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!

Add rows based on column value

DLopezNov 26 2015 — edited Nov 26 2015

Hi,

I'm trying to add n rows based on a column value.

For example this is the result I häve now

Name

People
Mike3
Bekenn1

With this I know that Mike has 2 more people with him and I need to 'inject' those 2 persons as Guest, each one as a row, also indicating that Mike is the 'parent' and the other 2 are the 'childs'.

Instead of choing the People column I can replace it with a 'Hierarchy' column indicating the hierarchy of them and also the childs have to be the rows next to the parent.

So the final result could be this

NameHierarchy
MikeParent
GuestChild

Guest

Child
BrekenParent

How can I do this?

thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2015
Added on Nov 26 2015
5 comments
1,638 views