次の SQL に 2 つの異なる結果セットがある理由を誰かが説明できますか?
SQL 1-
SELECT e.employee_id,e.first_name,
e.department_id,
d.department_id,
d.department_name
FROM employees e RIGHT OUTER JOIN departments d
ON (e.department_id = d.department_id) where d.department_name='Treasury';
結果: d.department_name='Treasury' のレコードのみ。
SQL 2-
SELECT e.employee_id,e.first_name,
e.department_id,`enter code here`
d.department_id,
d.department_name
FROM employees e RIGHT OUTER JOIN departments d
ON (e.department_id = d.department_id) and d.department_name='Treasury';
結果: すべての d.deparment_name 値を含むレコード。