Quote:
Originally Posted by tonkuma
should be re-written to
...
or
...
|
those two queries are different!
Code:
FROM ORACLE.EMPLOYEE A
LEFT OUTER JOIN
ORACLE.PID B
ON A.PID = B.PID
LEFT OUTER JOIN
ORACLE.DIV C
ON B.DIV_CODE = C.DIV_CODE
AND C.STATUS_CODE = 'A'
include rows of A and B, even if there is no row of C satisfying the conditions(no row with B.DIV_CODE = C.DIV_CODE or there is a row with B.DIV_CODE = C.DIV_CODE but C.STATUS_CODE <> 'A').
or
Code:
FROM ORACLE.EMPLOYEE A
LEFT OUTER JOIN
ORACLE.PID B
ON A.PID = B.PID
LEFT OUTER JOIN
ORACLE.DIV C
ON B.DIV_CODE = C.DIV_CODE
WHERE C.STATUS_CODE = 'A'
exclude rows of A and B without matching rows of C(C.STATUS_CODE = 'A').
it would be essentially same as inner join.