Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: case short circuits?
tq wrote:
> Question about this case statement below - is it actually evaluating
> the 3=3 or does it short ciruit? I'm trying to judge decode versus case
> in terms of potential performance differences.
>
> case when 1=2 and 3=3 then 0 else 1 end
>
> Thanks.
It is a good practice to always use parentheses to explicitly define your meaning.
case when (1=2 and 3=3) then 0 else 1 end
But in your case this is clearly impossible as your syntax is incorrect. No single value can ever be both a 1 and a 3.
Look up the correct syntax for the case statement at www.psoug.org
click on Morgan's Library
click on CASE
or at http://tahiti.oracle.com
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Mon Jun 20 2005 - 17:37:09 CDT