SELECT a.id,a.info_a,b.b_info
FROM table_a a,table_b b
WHERE a.id = b.id
UNION ALL
SELECT a.id,a.info_a,b.b_info
FROM table_a a,table_b b
WHERE a.id = b.id(+)
AND b.id IS NULL
UNION ALL
SELECT a.id,a.info_a,b.b_info
FROM table_a a,table_b b
WHERE a.id(+) = b.id
AND a.id IS NULL
ORDER BY 1
select a.id,a.info_a,b.b_info
from table_a a,table_b b
where a.id=b.id
union all
select a.id,a.info_a,' '
from table_a a
where not exists(select 1 from table_b b where a.id=b.id)
union all
select a.id,' ',b.info_b
from table_b b
where not exists(select 1 from table_a a where a.id=b.id)
order by 1
select a.id,a.info_a,b.b_info
from table_a a,table_b b
where a.id=b.id
union all
select a.id,a.info_a,' '
from table_a a
where not exists(select 1 from table_b where a.id=b.id)
union all
select a.id,' ',b.info_b
from table_b b
where not exists(select 1 from table_a where a.id=b.id)
order by 1