天天看点

使用sum函数求正数和与负数和

select sum(case when column> 0 then column else 0 end) as u0, 
sum(case when column <0 then column else 0 end ) as d0 from tablename