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!

use of case

siebelDOct 21 2013 — edited Oct 21 2013

Hi experts

I am using oracle 11G,my requirement is like below ,.

There is one staging table stg_td.

condition_type is one column in stg_td table .

we have base table s_mdf.

mapping between x_segment and condition_type column of staging like below .

{code}

x_segment                     STG_TD

NAT                              ZPRX,ZPRY

CDF or sales                 ZPAB,ZPBC

PFP                              ZPPB,ZPPY {code}

now as per above matching i have to select records from base table .

{code}select * from s_mdf base ,stg_td stg

where base.x_segment=case when stg.condition_type in (ZPRX,ZPRY) then NAT

                                    case when stg.condition_type in (ZPAB,ZPBC) then Sales

                                    case when stg.condition_type in(ZPPB,ZPPY) then PFP{code}

now here on above query is working only for segment NAT,Sales,PFP ...how I should include condition for CDF as it is of Or part of Sales

thanks

siebeld

This post has been answered by Mukesh75 on Oct 21 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 18 2013
Added on Oct 21 2013
2 comments
280 views