Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

How to achieve union all in Decode

user9977206Apr 17 2014 — edited Apr 21 2014

Dear Experts,

I have a table

Table Name :child_parent

Columns:

X1 X2X3X4
ABCD

AS per the requirement I need out put like

COL1 COL2

A        B

A       C

A       D

I HAVE achieved this by using the following

select x1 ,X2 from child_parent

union all

select X1,X3 from child_parent

union all

select X1,X4 from child_parent

Can we have any other approach with we can achieve in a better query.I appreciate your help in this regard.

Thanks,

Ravi

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 19 2014
Added on Apr 17 2014
7 comments
392 views