order by cast(col as int) desc,col asc

解决方案 »

  1.   

    order by ceiling (col ) - 1 desc,col asc
      

  2.   

    order by FLOOR(字段) desc,字段-FLOOR(字段) asc
      

  3.   

    declare @tb table (s decimal(10,2))
    insert into @tb select 2.01
    insert into @tb select 2.02
    insert into @tb select 2.03
    insert into @tb select 1.01
    insert into @tb select 1.02
    insert into @tb select 1.03select *
    from @tb 
    order by left(s,charindex('.',ltrim(s))-1) desc,s2.01
    2.02
    2.03
    1.01
    1.02
    1.03
      

  4.   


    declare @tb table (s decimal(10,4))
    insert into @tb select 2.021
    insert into @tb select 12.02
    insert into @tb select 32.03
    insert into @tb select 1231.01
    insert into @tb select 21.032
    insert into @tb select 12331.023select *
    from @tb 
    order by floor(s)s            
    ------------ 
    2.0210
    12.0200
    21.0320
    32.0300
    1231.0100
    12331.0230