select a.hm ,b.bs_name,c.lx_name from  zl a,bs b,lx c where  a.bs_id=b.bs_is and a.lx_id(+)=c.lx_id

解决方案 »

  1.   

    select a.hm ,b.bs_name,c.lx_name from  zl a,bs b,lx c where  a.bs_id=b.bs_is and a.lx_id=c.lx_id(+);
    应该是右关联吧?
      

  2.   

    select a.hm ,b.bs_name,c.lx_name from  zl a,bs b,lx c where  a.bs_id=b.bs_is and a.lx_id=c.lx_id and lx_name is not null;这也行的呀。
      

  3.   

    就是用左右联接来写了。根据你的实际选择某个where条件左或右联接。
      

  4.   

    外部联接"+"的用法   外部联接"+"按其在"="的左边或右边分左联接和右联接.若不带"+"运算符的表中的一个行不直接匹配于带"+"预算符的表中的任何行,则前者的行与后者中的一个空行相匹配并被返回.若二者均不带’+’,则二者中无法匹配的均被返回.利用外部联接"+",可以替代效率十分低下的 not in 运算,大大提高运行速度.例如,下面这条命令执行起来很慢 select a.empno from emp a where a.empno not in (select empno from emp1 where job=’SALE’);   倘若利用外部联接,改写命令如下: select a.empno from emp a ,emp1 b where a.empno=b.empno(+) and b.empno is null and b.job=’SALE’;   可以发现,运行速度明显提高.