其中bb.a1与aa.a1是一对多的关系

解决方案 »

  1.   

    -- 是这个意思吗?
    select aa.* from aa,bb
    where aa.a1 = bb.a1
    order by bb.b1
      

  2.   

    select aa.a1,aa.a2,aa.a3 from aa,bb where aa.a1=bb.a1  order by bb.b1
      

  3.   

    如表aa表数据:
    a1  a2  a3
    vc  0   1
    de  2   3
    aa  4   1
    fa  1   0
    cb  3   5
    yd  2   1表bb有数据
    b1   a1
    01   aa
    02   cb
    03   vc
    04   yd
    05   de
    06   fa我想让aa.a1按表bb中的a1列的顺序排序不知这次说明白没有
      

  4.   

    select aa.* from aa,bb
    where aa.a1 = bb.a1
    order by bb.b1
    --
    这个试试,好像没有问题。
      

  5.   

    bb表的a1字段不要排序吗? 还不是很明白你的要求.
    上面的应该可以了.如果只按B表B1字段排的话,选不全可能是因为你的a表中的a1字段在B表中的a1字段没有与之对应的.
      

  6.   

    搂主的意思,是否是说,表aa显示的不全?
    select aa.* from aa,bb
    where aa.a1 = (+)bb.a1
    order by NVL(bb.b1,'00');
      

  7.   

    select aa.* from aa
     ,
     (
       select bb.b1,bb,a2,rownum as rown from bb
     ) bbb
     where aa.a1=bbb.b1
     order by bbb.rown