select * from a where type='2' union all
select * from a where type<>'2' order by type

解决方案 »

  1.   

    ID NAME PATH TYPE
    要写存储过程,TYPE=2 
    -----------------
    select * from a 
    order by case type when 2 then 0 else 1 end
      

  2.   

    所有数据都要显示出来  只是TYPE =2 的显示在最上面
      

  3.   

    select * from a where type='2' union all
    select * from a where type<>'2' order by type-----------------
    select * from a 
    order by case type when 2 then 0 else 1 end
    -----------------
    guys, wow~~~ it's wonderful
      

  4.   

    所有数据都要显示出来  只是TYPE =2 的显示在最上面,TYPE是随机排序
      

  5.   

    这样还不行吗???select * from a 
    order by case type when 2 then 0 else 1 end
      

  6.   

    select * from a where type='2' union all
    select * from a where type<>'2' order by type
    这个排序不正确