Sum columns with null values in oracle

后端 未结 9 1756
抹茶落季
抹茶落季 2020-12-09 15:27

I want to add two numbers together but when one of those numbers is null then the result is null. Is there a way around this. I could simply do it in the code but I would

9条回答
  •  一生所求
    2020-12-09 16:07

    select type, craft, sum(NVL(regular, 0) + NVL(overtime, 0)) as total_hours
    from hours_t
    group by type, craft
    order by type, craft
    

提交回复
热议问题