Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Query Help
"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