RECAP - Conditions used in a Full Outer Join
I've created the simplest scenario with 2 tables containing matching records and non-matching from both sides, and tested all cases, in this sqlfiddle : http://sqlfiddle.com/#!3/901cd2/11
The fiddle was based on the answer of @JRLambert, of whom I've accepted the answer. This answer is just for summarizing and safekeeping.
Here are the SQL queries and explanations of this fiddle (in case it disappears one day) :
-- Basic full join
-- Returns (a,b) for matching records, and also (a, null) and (null, b)
-- for all records from A and B without matches
SELECT * FROM A
FULL OUTER JOIN B
ON A.pk = B.fk;
-- With condition in the ON clause
-- Only joins results (a,b) if conditions are satisfied on A.
-- The example returns :
-- 1. (a,b) only if A and B records are matched, and a.field = 0
-- 2. (a, null) for unmatched A records, and also all values of A with A.field != 0 (even if there is a matching B record)
-- 3. (null, b) for all unmatched B records, or with matching A records not satisfying the condition
SELECT * FROM A
FULL OUTER JOIN B
ON A.pk = B.fk AND A.field = 0;
-- With condition in the WHERE clause
-- Joins all matching record first, and return only pairs (a,b) and (a, null) if a satisfied the condition.
-- This example joins as the first "Basic full join", and then only returns rows with a satisfying the condition (meaning cannot be null)
SELECT * FROM A
FULL OUTER JOIN B
ON A.pk = B.fk
WHERE A.field = 0;
-- To select all join results satisfying the condition on A,
-- but keeping all B results as (null,b) whenever the condition is not true on A,
-- preselect keys before the join
SELECT *
FROM (SELECT A.pk FROM A WHERE A.field = 0) A
FULL OUTER JOIN B
ON A.pk = B.fk;