表1 (id int)
id
1
2
3如何显示
3
1
2

解决方案 »

  1.   

    select id from 表1 
    order by charindex('312')
      

  2.   

    declare @t table(a int)
    insert into @t select 1
    insert into @t select 2
    insert into @t select 3select * from @t order by case a when 3 then 1 when 1 then 2 when 2 then 3 else a endselect * from @t order by charindex(rtrim(a),'312')
      

  3.   

    select * from tb order by id % 3