Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Oracle SQL - Consultar 2 tabelas com base em suas chaves estrangeiras


Você pode obter o que deseja usando isso:
select *  from
(select name || ' ' || Surname Accounting from employees where depart_id = 1),
(select name || ' ' || Surname  IT from employees where depart_id =2)
union
select * from
(select name || ' ' || Surname Accounting from managers where depart_id = 1),
(select name || ' ' || Surname  IT from managers where depart_id =2)