正文
case when then 中判断null的方法
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
--下列SQL无效
SELECT CASE MAX(T.CREATE_TIME) WHEN NULL THEN TO_DATE('2019-03-05 00:00:01','yyyy-MM-dd hh24:mi:ss') ELSE MAX(T.CREATE_TIME) END AS CREATE_TIME FROM rpt_daily_transaction T;--需要用下面SQL
SELECT CASE WHEN MAX(T.CREATE_TIME) IS NULL THEN TO_DATE('2019-03-05 00:00:01','yyyy-MM-dd hh24:mi:ss') ELSE MAX(T.CREATE_TIME) END AS CREATE_TIME FROM rpt_daily_transaction T;