select a.id ,b.id from table a,table b
where a.id(+)=b.id  --这是左外连接
如果是a.id=b.id(+)--这是右外连接
当使用左外连接时如果a.id没有相应的值和b.id对应则以null值代替如:
a.id b.id
1     1
null  2
3     3
右外连接同理,如下:
a.id b.id
1     1
2     2
3     null其实你只要记着将(+)放在数据相对比较少的一边就行了

解决方案 »

  1.   

    +再有就是表示加法运算符了如下
    select 1+1 from dual
    输出
    2
      

  2.   

    +再有就是表示加法运算符了如下
    select 1+1 from dual
    输出
    2
      

  3.   

    select a.id,b.id from table a,table b where trim(a.id)=trim(b.id)(+);
    我试过,但是报错 line:1
                    ORA-01747: 无效的用户.表.列,表.列,或列规格
                    continue?
      

  4.   

    这样试试
    select a.id,b.id from table a,(select trim(id) id from table) b where trim(a.id)=b.id (+)
      

  5.   

    连接的地方不能用函数,像这样就不行了trim(a) (+) = trim(b)
    用我上面的方法应该可以的
      

  6.   

    select a.id,b.id from a,b where trim(a.id)=trim(b.id)(+);