NVL(value,substitute)
if value is null, this function is equal to substitute,
otherwise it is equal to value. Value can be any Oracle datatype;
substitute can be a literal, another column, or an expression but must
result in the same datatype as value.
-- ordinarily SUM ignores nulls:
SQL> select sum(hours) from works_on;
SUM(HOURS)
----------
296
-- but when everything summed is null, it returns null
SQL> select sum(hours) from works_on
2 where hours is null;
SUM(HOURS)
----------
-- to make nulls behave like 0, use NVL:
SQL> select sum(nvl(hours,0)) from works_on
2 where hours is null;
SUM(NVL(HOURS,0))
-----------------
0