select units from tablename where right(rtrim(units),4)>'0000'
select * from T where units <> round(units,1)
declare @t table(Units numeric(12,6)) insert @t select 2.000000 union select 1.222000 union select 1.200000 union select 3123.231 select * from @t where units <> round(units,1) /* Units -------------- 1.222000 3123.231000(所影响的行数为 2 行)*/
select * from yourTable where Units <> INT(Units )
== 思想重于技巧 ==
create table tb(units decimal(18,6)) insert into tb values(2.000000) insert into tb values(1.222000) insert into tb values(1.200000) insert into tb values(3123.231) goselect * from tb where (units * 100) - floor(units * 100) > 0drop table tb/* units -------------------- 1.222000 3123.231000(所影响的行数为 2 行)*/
declare @table table (Units decimal(18,6)) insert into @table select 2.000000 union all select 1.222000 union all select 1.200000 union all select 3123.231select * from @table where Units<> round(Units,2) /* 或者 */ select * from @table where Units<> round(Units,1)
from T
where units <> round(units,1)
insert @t select
2.000000 union select
1.222000 union select
1.200000 union select
3123.231 select *
from @t
where units <> round(units,1)
/*
Units
--------------
1.222000
3123.231000(所影响的行数为 2 行)*/
from yourTable
where Units <> INT(Units )
insert into tb values(2.000000)
insert into tb values(1.222000)
insert into tb values(1.200000)
insert into tb values(3123.231)
goselect * from tb where (units * 100) - floor(units * 100) > 0drop table tb/*
units
--------------------
1.222000
3123.231000(所影响的行数为 2 行)*/
declare @table table (Units decimal(18,6))
insert into @table
select 2.000000
union all
select 1.222000
union all
select 1.200000
union all
select 3123.231select * from @table where Units<> round(Units,2)
/*
或者
*/
select * from @table where Units<> round(Units,1)