select a.*,b.*
from a ,b
where a.comm=b.comm(+);

解决方案 »

  1.   

    是不是想这样:

    comm
    -----
    1
    2
    3b
    comm     x
    -----------
    1        1
    1        2
    1        3
    2        1
    2        3
    结果:
    comm     x1   x2   x3
    ---------------------
    1         1    2    3
    2         1   null  3
    3        null null null
      

  2.   

    参考:
    http://expert.csdn.net/Expert/topic/1693/1693233.xml?temp=.3707392
      

  3.   

    就是suleen的意思,如何构造这样的SQL语句?
      

  4.   

    BlueskyWide(谈趣者) 参考的帖子是指内连接与外连接的问题,不是记录集的字段附加问题吧
      

  5.   

    select a.*,b.field1,b.field2,b.field3 
     from a,b where a.comm(+)=b.comm;
      

  6.   

    这样出现的结果是表b的记录数,不是表a的记录数,比如:表a有一条记录,表b的查询结果有三条记录,得到的结果为三条记录,表a的字段会重复三次,但我想要的结果应为一条记录,而字段数为表a与表b的字段数之和,
      

  7.   

    select a.comm, max(decode(b3.no,1,b3.x,null)),max(decode(b3.no,2,b3.x,null)),
           max(decode(b3.no,3,b3.x,null))
    from  a,(select count(*) no, b1.comm,b1.x from b b1,b b2
         where b1.comm=b2.comm and b1.rowid >= b2.rowid
         group by b1.comm,b1.x ) b3
    where a.comm=b3.comm(+)
    group by a.comm