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!

Multiple columns in IN clause

Rahul_IndiaJun 19 2013 — edited Jul 3 2013

Hi,

select * from nrc_trans_descr where type_id_nrc=60013   -- it has 18 columns and i have hard coded 60013 for simplification here.60013 is derived from 3 other table

Output is ( it can have many rows too.typically for each type_id_nrc there is one row ).

TYPE_ID_NRC  TRIGGER_STATUS  INSTALLMENT_TYPE_ID_NRC

---------------------------------------------------------------------

      60013              0                 61013                  

i have to pass TYPE_ID_NRC  and  INSTALLMENT_TYPE_ID_NRC to restriction_id column in a different table.

currently i am doing like this

select * FROM DISCOUNT_RESTRICTIONS WHERE discount_id in (12085,12086)

and (restricted_id in (  select type_id_nrc from nrc_trans_descr where type_id_nrc=60013)

or restricted_id in (  select installment_type_id_nrc from nrc_trans_descr where type_id_nrc=60013));

Any better way do achoieve this?I am using ORACLE 10GR2(solution for 11gr2 is welcome too)

Thanks.

By mistake i marjked this question as ASSUMED ANSWER. How to UNDO this?

Message was edited by: Rahul_India

This post has been answered by Greg Spall on Jun 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 31 2013
Added on Jun 19 2013
16 comments
1,212 views