select * from tbname where A=1
union all
select * from tbname where A<>1 order by A;

解决方案 »

  1.   

    测试:
    create table tb_1 (a number,b varchar(10));insert into tb_1 values(1,   'a');
    insert into tb_1 values(1 ,  'g');
    insert into tb_1 values(2  , 'c');
    insert into tb_1 values(3   ,'t');
    insert into tb_1 values(4   ,'8');
    insert into tb_1 values(0   ,'9');select * from tb_1 order by decode(a,1,1,2),a;
    /*
             A B
    ---------- ----------
             1 a
             1 g
             0 9
             2 c
             3 t
             4 8已选择6行。
    */
      

  2.   

    txlicenhe(马可) 的方法有创意.bzszp(www.bzszp.533.net)的方法很常用. 学习两位.
      

  3.   

    select * from ABC order by decode(A,1,-1,A);
      

  4.   

    to bzszp(www.bzszp.533.net) :
    你的做法有问题,应该是这样的select * from tb_1 where a=1
    UNION ALL
    (SELECT * FROM (select * from tb_1 where a<>1   order by a))
    /         A B
    ---------- ----------
             1 a
             1 g
             0 9
             2 c
             3 t
             4 86 rows selected