DB2数据库 CASE WHEN的使用

select CASE WHEN T1.COMMERCIALENDDATE IS NULL THEN T1.INSURANCEMATURITYDATE WHEN YEAR(T1.COMMERCIALENDDATE) = 2014  
    THEN T1.COMMERCIALENDDATE WHEN YEAR(T1.INSURANCEMATURITYDATE) = 2014 THEN T1.INSURANCEMATURITYDATE ELSE T1.COMMERCIALENDDATE END as m, T1.INSURANCEMATURITYDATE
    ,T1.COMMERCIALENDDATE FROM RT_INSURANCEBUY T1

 

posted @ 2014-12-10 17:21  沙耶  阅读(12995)  评论(0编辑  收藏  举报