select A.a,A.b,B.d from A,B where A.a='某个值' and A.b=B.c(+);

解决方案 »

  1.   

    select a.a,a.b,b.d from a,b where a.a='某个值' and a.b=b.c(+)
      

  2.   

    自已动手试试嘛,A.b=B.c(+) 相当于left join
      

  3.   

    在数据库原理里,如果A.b=B.c时如B.d有值则选出,无值不被选出,称为自然联接,如果也想选出
    B.d无论它是否为空的话,那么称为左联接!
    understand?:)
      

  4.   

    可能举的例子太简单了,对上面的例子是可以的,我还是举个实际的例子
    S(company,stall,etindex,...),M(etindex,posname,posnum,enterprise,...),C(recno,name,...)
    现在select c.name,m.posname,m.posnum
    条件是s.etindex='某个值',s.company=c.recno  并且当m.enterprise=s.company and m.etindex=s.etindex,选出m.posname,m.posnum,如果没有就使m.posname,m.posnum 为空,可是这样写 m.enterprise=s.company(+) and m.etindex=s.etindex(+)不行啊?
      

  5.   

    select a.a,a.b,b.d from a,b where a.a='某个值' and a.b=b.c(+)
      

  6.   

    m.enterprise=s.company(+) and m.etindex=s.etindex(+)1. (+)要改为(+)2.(+)放错位置了,应该是m.enterprise(+)=s.company and m.etindex(+)=s.etindex
      

  7.   

    外连接是不能实现的
    当where语句中包含了其它的条件语句时
    无法实现外连接供目的,而且也表达不清楚外连接的目的
    不过你可以进行嵌套封装
    应该能够实现select a,b,d
    from (
    select A.a,A.b,B.c,B.d,
    FROM A,B
    WHERE A.a = B.c(+) )
    where A.a='某个值';