如何把小数后面后面超过两位的数全部检索出来如100.3123121231.231231.234234103.232423415.4645656456
查询结果
1.2342343.23242345.4645656456

解决方案 »

  1.   

    select * into #t from (
    select 123121231.23  a union all 
    select 100.3 union all 
    select 1231.234234 union all 
    select 103.2324234 union all 
    select 15.4645656456  ) tselect * from #tselect * from #t
    where a-cast(a as decimal(18,2))>0
    /*
    a
    ---------------------------------------
    1231.2342340000
    103.2324234000
    15.4645656456
    */
      

  2.   

    select * into #t from (
    select 123121231.23  a union all 
    select 100.3 union all 
    select 1231.234234 union all 
    select 103.2324234 union all 
    select 15.4645656456  ) tselect * from #tselect a%10 as a from #t
    where a-cast(a as decimal(18,2))>0
    /*
    a
    ---------------------------------------
    1.2342340000
    3.2324234000
    5.4645656456*/
      

  3.   

    select * from tb where a-cast(a as decimal(18,2))>0