求解 谢谢

解决方案 »

  1.   

    SQL> select * from t1;        ID NAME
    ---------- ----------
             1 wh
             2 wpSQL> select * from t2;        ID NAME
    ---------- ----------
             2 wy
             3 wwSQL> select t1.*,t2.*
      2  from t1,t2
      3  where t1.id(+)=t2.id;        ID NAME               ID NAME
    ---------- ---------- ---------- ----------
             2 wp                  2 wy
                                   3 wwSQL> select t1.*,t2.*
      2  from t1,t2
      3  where t1.id=t2.id;        ID NAME               ID NAME
    ---------- ---------- ---------- ----------
             2 wp                  2 wy
      

  2.   

    相当也 from a right join b
      on a.id = b.id不是 简单的left join
      

  3.   

    (+)代表外连接的意思t2表中的3 ww这条记录虽然在t1表中没有相对应的记录
    但是仍然显示了出来
      

  4.   

    SQL> select t1.*,t2.*
      2  from t1,t2
      3  where t1.id=t2.id(+);        ID NAME               ID NAME
    ---------- ---------- ---------- ----------
             2 wp                  2 wy
             1 wh