Вы можете написать свой запрос следующим образом.
select coalesce(id1, id2) as id
from (
select t1.id as id1
,t2.id as id2
from table1 t1
left join table2 t2 on t1.id = t2.id
union
select t1.id as id1
,t2.id as id2
from table1 t1
right join table2 t2 on t1.id = t2.id
) T
where t.id1 is null
or t.id2 is null