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 -> case statement for oracle ?

case statement for oracle ?

From: Sebastian Kloska <kloska_at_mpimp-golm.mpg.de>
Date: Mon, 21 Jun 1999 11:26:19 +0200
Message-ID: <376E053B.8B2006FF@mpimp-golm.mpg.de>


 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

--



Dr. Sebastian Kloska; Max-Planck Institut für Mol. Pflanzenphysiologie
Karl Liebknecht Straße 25;     14476 Golm;     Tel: (+49 030) 84131542  
* NEW MAIL ADDRESS *                   mailto:kloska_at_mpimp-golm.mpg.de
Received on Mon Jun 21 1999 - 04:26:19 CDT

Original text of this message

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