如何写入where

时间:2018-06-05 14:19:44

标签: oracle case

如何在where子句下将此代码编写为case语句?

IF trim$(ps_status) <> "" AND NOT isnull(ps_status) THEN 
SELECT CASE ps_status
CASE 'O'
     p_con.pipeline_tx_status = 'O'
CASE 'MFT'
    p_con.pipeline_tx_status = 'MFT'
CASE 'IS'
    p_con.pipeline_tx_status = 'IS'
CASE 'CNF'

    (p_con.pipeline_tx_status in ('CNF') OR  (p_con.pipeline_tx_status in('OI','ICF','C') AND NVL(CONSOL.ACCOUNTING_STATUS,'O') NOT IN ('O'))) 
CASE 'OI'
    p_con.pipeline_tx_status = 'OI'
CASE 'ICF'
    p_con.pipeline_tx_status = 'ICF'
CASE 'C'
    p_con.pipeline_tx_status = 'C'
END SELECT
END IF

0 个答案:

没有答案