Re: Computing percentage change between tables

From: novice82 <novice82_at_gmail.com>
Date: Tue, 21 Jul 2009 01:13:46 -0700 (PDT)
Message-ID: <e5bee775-68b5-44b9-ad48-74f1bf8a02b7_at_u16g2000pru.googlegroups.com>



On Jul 20, 5:14 pm, "Álvaro G. Vicario"
<alvaro.NOSPAMTH..._at_demogracia.com.invalid> wrote:
> novice82 escribió:
>
> > another question, that I have is, how does sql handle the computation,
> > if a value in a particular field is divided by 0 ?
>
> It raises a ORA-01476 error ("divisor is equal to zero"). You can test
> it yourself:
>
> SELECT 1/0
> FROM DUAL
>
> --
> --http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
> -- Mi sitio sobre programación web:http://borrame.com
> -- Mi web de humor satinado:http://www.demogracia.com
> --

Hi,

I tried the following :

SELECT T1.AcountNo, T1.Balance, T2.Balance, T1.Balance/CASE T2.Balance WHEN 0 THEN NULL END)
FROM Temp1 T1, Temp2 T2
WHERE T1.AccountNo = T2.AccountNo
AND ((T1.Balance / T2.Balance > 1.1)
OR (T1.Balance / T2.Balance < 0.9))

But i'm still unable to circumvent the zero divisor problem.

Any help, will be appreciated.

thanks :) Received on Tue Jul 21 2009 - 03:13:46 CDT

Original text of this message