字段money是numeric型,当查询条件为 money>=0 and money<=10000时 ,总是把大于10000的记录也找出来,求解决方法
字段money是numeric型,当查询条件为 money> =0 and money <=10000时 ,总是把大于10000的记录也找出来,但是查询条件为 money> =0 and money <=1000时又都是正确的
求解决方法? 谢谢
--------------------
money> =0 and money <=1000时查询分析器中结果
money
960.0000
940.0000
880.0000
880.0000
830.0000
800.0000
-----------------------------------------
money> =0 and money <=10000时查询分析器中结果
money
27200.0000
16000.0000
13744.0000
10000.0000
10000.0000
10000.0000
9970.0000
9900.0000
9760.0000
9700.0000
------解决方案--------------------where money between 0 and 10000
------解决方案--------------------是啊between就好
> = ——> (A> B or A=B)
------解决方案----------------------try
money> =0.0 and money <=1000.0
------解决方案--------------------create table T([money] numeric)
insert T select 27200.0000
union all select 16000.0000
union all select 13744.0000
union all select 10000.0000
union all select 10000.0000
union all select 10000.0000
union all select 9970.0000
union all select 9900.0000
union all select 9760.0000
union all select 9700.0000
select * from T
where [money] between 0 and 10000
--result
money
--------------------
10000
10000
10000
9970
9900
9760
9700
(7 row(s) affected)
------解决方案--------------------確實有點奇怪哦!
------解决方案--------------------楼上正解
------解决方案--------------------楼主我看好你哦~