你上面都没有对bbzl列用到外连接,转到oracle时怎么加上了(+)?

解决方案 »

  1.   

    oracle里面可以用(+),你的写法是因为一个表做了两次(+).
    试一下:
    select a.yqdh,a.xmdh,b.xmcdz     
    from a a,b b,b c                <---  b,c是同一个表.根据需要查询.
    where a.yqdh =b.yqdh(+) and
          a.xmdh =c.xmdh(+) and
          a.yqdh = 'au600' and
          (b.bbzl is null or b.bbzl ='1') and
          (b.nlxx >=44 and b.nlsx <=44);
      

  2.   

    如果用(+)还真的不可以在or里用外连接!
    但是可以用left(right) jion on 就可以了!
    具体怎么写,自己揣摩一下!