Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQLPLUS divide by zero question
select decode(sum(B),0,sum(A)/sum(B)) from table T;
Iancrozier wrote:
> I am trying to run a sql statement, something like this:
>
> select sum(A)/sum(B) from table T;
>
> Sometimes sum(B) is equal to zero. Is there any way in sqlplus I can run this
> or
> do I have to go to PL/SQL?
>
> Thanks in advance.
Received on Mon Aug 24 1998 - 22:05:11 CDT
![]() |
![]() |