 <p>Are you looking for this?</p> <pre><code>SELECT A, B, D, E, COALESCE(C, F) M FROM relation1 r1 FULL JOIN relation2 r2 ON r1.C = r2.F </code></pre> <p>Assuming relation1:</p> <pre> | A | B | C | --------------- | a1 | b1 | 1 | | a2 | b2 | 2 | </pre> <p>and relation2:</p> <pre> | D | E | F | --------------- | d1 | e1 | 1 | | d3 | e3 | 3 | </pre> <p>Output will be</p> <pre> | A | B | D | E | M | ----------------------------------------- | a1 | b1 | d1 | e1 | 1 | | a2 | b2 | (null) | (null) | 2 | | (null) | (null) | d3 | e3 | 3 | </pre> <p>Here is <strong><a href="http://sqlfiddle.com/#!1/93434/2" rel="nofollow">SQLFiddle</a></strong> demo</p>