Oracle
 sql >> Base de données >  >> RDS >> Oracle

Oracle SQL - Interroger 2 tables en fonction de leurs clés étrangères

Vous pouvez obtenir ce que vous voulez en utilisant ceci :

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)