Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Query Syntax Question...

Query Syntax Question...

From: Kent P. Iler <kent_at_iler.NOSPAM.com>
Date: Sun, 01 Oct 2000 16:32:45 GMT
Message-ID: <NGJB5.2201$9O3.292683@typhoon.mw.mediaone.net>

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.

Received on Sun Oct 01 2000 - 11:32:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US