select a.studentno, a.studentname, b.classname
      from students a, classes b
      where a.classid(+) = b.classid;
是左连接还是右连接呢?
有的说:即"(+)"所在位置的另一侧为连接的方向。那么上面的就是右连接。
也有的说:加号写在左就是左连接,写在右就是右连接,看加号的方法来定。那么上面的就是左连接。
都搞晕了到底哪个对呢?

解决方案 »

  1.   

    To write a query that performs an outer join of tables A and B and returns all rows from B (a right outer join), use the RIGHT [OUTER] JOIN syntax in the FROM clause, or apply the outer join operator (+) to all columns of A in the join condition in the WHERE clause. For all rows in B that have no matching rows in A, Oracle returns null for any select list expressions containing columns of A.
    (+)用在A的列上,所以是a right outer join