| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Need help with SQL Statement
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
![]() |
![]() |