SELECT COALESCE(t1.id, t2.id) as id, t1.value1, t2.value2 FROM table1 t1 FULL JOIN table2 t2 ON t1.id = t2.id;