Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to compare NUMBER's >>>>> How to avoid the error of 'divided by zero'?
Jimmy says...
> Sorry, I may not describe the question in the right way because of the
> confusing result.
>
> But I still wonder how this can be even if I use WHERE s2<>0 and
> (s1-s2)/s2>0.5?
select
(case when s2=0 then 'a null result' -- must be first in case statement
when (s1-s2)/s2>0.5 then 'a big result' else 'not a big result' end) div_resultfrom table_with_s1_and_s2;
GM Received on Thu Aug 09 2007 - 00:33:01 CDT
![]() |
![]() |