SQL 2005的SUM是不是有问题?

今天遭遇离奇的一个问题:

select t_itbp, t_amth_1 from ttfacr200200
where (t_ttyp ='S01' or t_ttyp ='S02')
and t_docd >='2007-01-01' and t_docd <='2007-11-01'
and t_itbp = 'IZZ000002'
and t_lino =0

t_itbp    t_amth_1
--------- ----------------------
IZZ000002 3175.43
IZZ000002 101416.75
IZZ000002 -104592.19
IZZ000002 73.79
IZZ000002 2356.59
IZZ000002 0.01
IZZ000002 -2430.37
IZZ000002 -0.01

 

 

select sum(t_amth_1) from ttfacr200200

where (t_ttyp ='S01' or t_ttyp ='S02')
and t_docd >='2007-01-01' and t_docd <='2007-11-01'
and t_itbp = 'IZZ000002'
and t_lino =0

----------------------
-7.96717379569767E-12

(1 行受影响)

 

select 3175.43+101416.75-104592.19+73.79+2356.59+0.01-2430.37-0.01

---------------------------------------
-0.00

(1 行受影响)

 

看出来了吗?

为什么使用Sum(t_amth_1)出来的值是-7.96717379569767E-12 和实际的-0.00差异这么大呢?

posted @ 2007-11-19 11:45  Jeffers Yuan  阅读(557)  评论(2编辑  收藏  举报