读书人

字段money是numeric型当查询条件为

发布时间: 2012-01-19 00:22:27 作者: rapoo

字段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)
[解决办法]
有奇怪哦!
[解决办法]
楼上正解
[解决办法]
楼主我看好你哦~

读书人网 >SQL Server

热点推荐