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'?
Sorry, I may not describe the question in the right way because of the
confusing result.
Well, now I got to know that is a problem about devided by zero.
As oracle sql will raise an error of attempting to divided by zero.
But I still wonder how this can be even if I use WHERE s2<>0 and
(s1-s2)/s2>0.5?
I have to change it to (s1-s2)/decode(s2,0,100,s2)>0.5, which is definitely
only a cheat
to the interpreter.
I wonder if there is some way elegant to avoid that?
Version: Oracle9i Enterprise Edition Release 9.2.0.1.0 OS: WinXP Received on Wed Aug 08 2007 - 23:54:25 CDT