oracle 如图,我查到的红色方框内没有数据,如何用0进行代替,我用了NVL但是不行


select a.name, a.num as "二", b.num as "三", a.num / 5, b.num / 5
  from (select name, count(cishu) num
          from ceshi
         where shijian >= to_date('2021-01-01', 'yyyy-MM-dd')
           and shijian <= to_date('2021-01-31', 'yyyy-MM-dd')
         group by name) A
  left join (select name, count(cishu) num
               from ceshi
              where shijian >= to_date('2021-2-01', 'yyyy-MM-dd')
                and shijian <= to_date('2021-2-28', 'yyyy-MM-dd')
              group by name) b
    on a.name = b.name

img


查询数据

img

case when b.num is null then 0 else b.num end as 三