| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.server -> Re: Help with this Select statement please
I have 2 tables
Harry wrote:
>Customer                      Importance
>=======                     ==========
>cust_id                          id
>priority_id                    descr
>status_id
>priority_id & status_id are both foreign keys for the >Importance
table's
>primary key id field.
>I'm trying to work out how to construct a SELECT statement >like -
select
>cust_id, descr (based on priority_id), descr (based on >status_id) but
as
>they are in the same table it's really confusing!
  1  SELECT
  2    custid,
  3    b.desc priority_description,
  4    c.desc status_description
  5  FROM
  6    customer a,
  7    importance b,
  8    importance c
  9  WHERE a.priority_id = b.id
 10*   AND a.status_id = c.id
chet Received on Tue Apr 26 2005 - 09:59:31 CDT
|  |  |