Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> case statement for oracle ?
Hi,
Is their anything like a case statement in the form
CASE
WHEN val=0 then null
ELSE val
END
for Oracle. My SQL books claim that 'CASE' is ANSI SQL but
Oracle doesn't seem to support is. The only way to somehow
emulate it seems to be a union in the form
SELECT val from tab where val<>0
UNION
SELECT null from tab where val=0
This would become rather ugly in my case because tab is a rather
complex
subquery which I would have to state twice.
Thank you for any help...
Sebastian
--
Karl Liebknecht Straße 25; 14476 Golm; Tel: (+49 030) 84131542 * NEW MAIL ADDRESS * mailto:kloska_at_mpimp-golm.mpg.deReceived on Mon Jun 21 1999 - 04:26:19 CDT
![]() |
![]() |