读书人

如何获取金额那些是正数那些是负数

发布时间: 2012-03-12 12:45:33 作者: rapoo

怎么获取金额那些是正数,那些是负数
请问表中的金额字段怎么获取那些是正数,那些是负数。
谢谢

[解决办法]

SQL code
declare @T table (col money)insert into @Tselect 3.23 union allselect 4.54 union allselect -1.9 union allselect 9.8 union allselect -1.3select * from @T where col>0select * from @T where sign(col)=1/*col---------------------3.234.549.80*/select * from @T where col<0select * from @T where sign(col)=-1/*col----------------------1.90-1.30*/ 

读书人网 >SQL Server

热点推荐