Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Query Syntax Question...
Hi,
How do I (or can I?) write a query to pull back the ID's and names in the following schema?
committee_table: Committee_ID int, Treasurer_ID int, Secretary_ID int --------------------
Employee_table:
Employee_ID int,
FNAME varchar, LNAME varchar
The problem is all employees are in one table. I want to pull back the name of each employee that matches the committee ID, so the output I would like to see is:
Committee_ID Treasurer_ID Treasurer_Name Secretary_ID Secretary_Name
So each row of the committee_table would need to reference 2 rows in the Employee table, 1 for the treasurer and 1 for the secretary.
Obviously a join would work if I only had 1 name to reference, but I'm having trouble with the 2 names. I don't know if there is a more complex join that could work here.
Thanks.
![]() |
![]() |