decode只能做等值的,case when可以做区间的,decode能做到的,case when也能做到。
效率方面,个人觉得两者效率差不多。
但decode的语法要简单些,但它只能做等值的比较
case when end 能做条件的判断
select case when b.total_fee is null then 0 else b.total_fee end from t_pm_billing_stat b
select a.area_name, decode(b.billing_amount,null,0 ,b.billing_amount) from t_pm_billing_stat b