select sum(aa),sum(bb),count(bb),count(*),sum(aa+bb),sum(aa)+sum(bb) from

(select 1 aa,null bb from dual union all select 2 aa,1 bb from dual) tt

结果为:

 

SUM(AA) SUM(BB) COUNT(BB) COUNT(*) SUM(AA+BB) SUM(AA)+SUM(BB)
3 1 1 2 3 4