Oracle
 sql >> Database >  >> RDS >> Oracle

Oracle SQL:interroga 2 tabelle in base alle loro chiavi esterne

Puoi ottenere quello che vuoi usando questo:

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)