日期:2014-05-19  浏览次数:20671 次

如何查出小数点后两位不为零的数据?
如题,如何查出小数点后两位以上不为零的数据?
a(numeric(9,4))
123.15
12.0
100
356.545
123.45

查出结果应该如下
123.15
356.545
123.45

------解决方案--------------------
select *
from 表名
where round(a,0) <> a
------解决方案--------------------
declare @t table(a numeric(9,4))
insert @t
select 123.15 union all
select 12.0 union all
select 100 union all
select 356.545 union all
select 123.45

----查询
select * from @t where floor(a*10) <> a*10


/*结果
a
-----------
123.1500
356.5450
123.4500
*/