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!

selecting multiple values inside decode

490527Mar 6 2006 — edited Mar 8 2006
I have query as follows,

select decode(col1,'X',(select col2,col3 from tab1),'Y',(select col4,col5 from tab2)) from dual

It works only if i select only 1 column(col2 or col3 & col4 or col5) in either of the two select queries.
but i need to select multiple values by decoding 1 value.

Is there a better approach?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2006
Added on Mar 6 2006
10 comments
5,571 views