健壮程序之--SQL优化
(仅为自己以后快速参考!!!)
(1)防止数据库字段为空
解决方案(1):DECODE()
DECODE(JN.USERID, 0, '待聘', UI.USERNAME) USERNAME,
解决方案(2):CASE...WHEN
(CASE WHEN YTD_SUBMIT_NUM IS NOT NULL THEN YTD_SUBMIT_NUM ELSE -1 END) AS YTD_SUBMIT_NUM,
(2)
(仅为自己以后快速参考!!!)
(1)防止数据库字段为空
解决方案(1):DECODE()
DECODE(JN.USERID, 0, '待聘', UI.USERNAME) USERNAME,
解决方案(2):CASE...WHEN
(CASE WHEN YTD_SUBMIT_NUM IS NOT NULL THEN YTD_SUBMIT_NUM ELSE -1 END) AS YTD_SUBMIT_NUM,
(2)