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

Home -> Community -> Usenet -> c.d.o.server -> Re: Help with this Select statement please

Re: Help with this Select statement please

From: Chet Justice <chet.justice_at_pfsf.org>
Date: 26 Apr 2005 07:59:31 -0700
Message-ID: <1114527571.290780.180620@g14g2000cwa.googlegroups.com>


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

Original text of this message

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