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: Query Help

Re: Query Help

From: Alex Filonov <afilonov_at_pro-ns.net>
Date: Fri, 29 Dec 2000 16:25:31 GMT
Message-ID: <92idti$hrm$1@nnrp1.deja.com>

You can use one lookup table, you just have to join it three times to your table. Like this:

select t.source1, l1.desc desc1, t.source2, l2.desc desc2,
       t.source3, l3.desc desc3
from yourtable t, lookuptable l1, lookuptable l2, lookuptable l3
where l1.source = t.source1

  and l2.source = t.source2
  and l3.source = t.source3

In article <92i3vr$9q1$1_at_nnrp1.deja.com>,   sboucher_at_my-deja.com wrote:
> I have a table that includes three fields: Source1 , Source2, Source3.
>
> Source 1,2,3 can only include values 01 through 05 and only Source1
> must have a value entered. Intakeid is the primary key for this table.
>
> I want to bring back the description for the code entered into
 Source1,
> Source2, Source3 from a single lookupvalue table but can only seem to
> make it work if I have three separate lookupvalue tables corresponding
> to the three source fields.
>
> Is there a better way. I cannot change the design of the tables.
> Output to look as follows:
>
> Source1 Desc Source2 Desc Source3 Desc
> 01 01desc 0300 03desc 05 05desc
> 02 02desc
>
> Thanks
> Scott
>
> Sent via Deja.com
> http://www.deja.com/
>

Sent via Deja.com
http://www.deja.com/ Received on Fri Dec 29 2000 - 10:25:31 CST

Original text of this message

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