日期:2014-05-18  浏览次数:20451 次

如何使用sum函数求正数和与负数和
各位下午好:
请问如何用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