如列表所示:都是选填字段
name age salary weight
张三 18 20
李四 17
王五 21
燕小六 15 22
sum(age+salary+weight)这种写法是不能求出这三列的和的,
因为在oracle中,18+null的结果还是null,
正确写法是:sum(nvl(age,0)+nvl(salary,0)+nvl(weight,0))
如列表所示:都是选填字段
name age salary weight
张三 18 20
李四 17
王五 21
燕小六 15 22
sum(age+salary+weight)这种写法是不能求出这三列的和的,
因为在oracle中,18+null的结果还是null,
正确写法是:sum(nvl(age,0)+nvl(salary,0)+nvl(weight,0))