Lakukan saja gabungan luar tetapi juga gunakan penggabungan
SELECT
COALESCE(a.master,b.master) master,
a.ColA,
b.ColB
FROM
a FULL OUTER JOIN B
ON a.master = b.master
AND (a.ColA = b.ColB
or a.ColA is Null
or b.ColB is Null)
ORDER BY
COALESCE(a.master,b.master),
COALESCE(a.cola,b.colB)
Lihat cara kerjanya di sini