Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to compare NUMBER's >>>>> How to avoid the error of 'divided by zero'?

Re: How to compare NUMBER's >>>>> How to avoid the error of 'divided by zero'?

From: Jimmy <lofenee_at_yahoo.com.cn>
Date: Thu, 9 Aug 2007 12:54:25 +0800
Message-ID: <f9e9l8$aid$1@news.cn99.com>


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

Original text of this message

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