1. 程式人生 > >報表本年對應的上一年資料為空時,將空轉換為0

報表本年對應的上一年資料為空時,將空轉換為0

update session.results set tq_qty= case when tq_qty=0 or tq_qty is null then 0 else tq_qty end,
                                   tq_zb= case when tq_zb=0 or tq_zb is null then 0 else tq_zb end,
                                   zbadd= case when zbadd=0 or tq_zb is null then 0 else zbadd end;