TD中case when的使用
对不同情况的判断取值
示例:
CASE WHEN T.ORGNL_TERM_DAYS <=60 THEN 'M01'
WHEN T.ORGNL_TERM_DAYS >60 AND T.ORGNL_TERM_DAYS<=135 THEN 'M03'
WHEN T.ORGNL_TERM_DAYS >135 AND T.ORGNL_TERM_DAYS<=270 THEN 'M06'
WHEN T.ORGNL_TERM_DAYS >270 THEN 'Y01'
END
CASE WHEN T.ORG_ID='999999' THEN T.TX_CAP
WHEN SUBSTR(T.SUBJ_NUM,1,3)IN('150','250','253','254') THEN T.CURR_BAL
ELSE T.PRINCIPALAMPUNT AS CURR_BAL