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

Home -> Community -> Usenet -> c.d.o.tools -> Need help with SQL Statement

Need help with SQL Statement

From: Elliott Mehrbach <elliottj_at_ispchannel.com>
Date: 2000/07/19
Message-ID: <fEmd5.2627$0H4.1957347@news1.onlynews.com>#1/1

I am trying to duplicate a select statement that is currently in use in MS-Sql Server:

select T1.PKEY as T1_PrimaryKey,

          T2.PKEY as T2.PrimaryKey,
          T3.PKEY as T3.PrimaryKey,
        FldValue =
       CASE
         WHEN T1.FIELD1 is not null THEN T1.FIELD1
         WHEN T2.FIELD1 is not null THEN T2.FIELD1
         WHEN T3.FIELD1 is not null THEN T3.FIELD1
       END
from TABLE1 T1,
         TABLE2 T2,
         TABLE3 T3
where T2.FKEY = T1.PKEY
and     T3.FKEY = T2.PKEY

I am using CASE. In Oracle I usually use DECODE. But I do not see how to do that in this case. Any suggestions would be greatly appreciated.

Elliott Received on Wed Jul 19 2000 - 00:00:00 CDT

Original text of this message

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