SELECT RT.CONTRACT_NUM ,RT.CONTRACT_LINE_NUM ,RT.EFFDT ,CASE WHEN RT.RATE_TMPL_OPTION IN ('CRTP' ,'URTP') THEN RP.LANGUAGE_CD ELSE RS.LANGUAGE_CD END ,CASE WHEN RT.RATE_TMPL_OPTION IN ('CRTP' ,'URTP') THEN RP.DESCR ELSE RS.DESCR END FROM ((PS_CA_RATE RT LEFT OUTER JOIN PS_PC_RATE_HDR_LG RS ON RT.BUSINESS_UNIT_PC = RS.BUSINESS_UNIT AND RT.PC_TEMPLATE_ID = RS.PC_TEMPLATE_ID) LEFT OUTER JOIN PS_PC_RATE_PLAN_LG RP ON RT.BUSINESS_UNIT_PC = RP.BUSINESS_UNIT AND RT.RATE_PLAN = RP.RATE_PLAN) ,PS_CA_DETAIL DTL WHERE RT.CONTRACT_NUM = DTL.CONTRACT_NUM AND RT.CONTRACT_LINE_NUM = DTL.CONTRACT_LINE_NUM AND DTL.CA_LINE_STATUS <>'C' AND DTL.CHG_STATUS <> 'X'
|