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: gmuldoon <gmuldoon_nospam_at_scu.edu.au>
Date: Fri, 30 Jul 2004 03:06:47 GMT
Message-ID: <MPG.1b746645e3bfbd21989729@news.asgard.net.au>


"Robert Nurse" <rnurse_at_cudbytech.net> wrote in message
> I've got a report to do and I need a little help with the query.
> Here's the table structure
>
> rowID PK
> descriptiveName
> Col2 FK
> Col3
> Col4
> Col5
> Col6
>
> Col3 through Col6 contain values taken from rowID. Just as a side
> note, this table is not normalized. Correct? Anyway, when I query
> the table instead of displaying the data in Col3 through Col6, I'd
> like to display the corresponding descriptiveName for those values.
> Could someone give me a hint at a PL/SQL solution for this? I'm new
> to PL/SQL.

If I've got your questions right, try:

select rowID, descriptiveName, (select descriptiveName from tableName b where b.rowId = a.Col2) as "Col2", <..etc...> from tableName a

GM Received on Thu Jul 29 2004 - 22:06:47 CDT

Original text of this message

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