Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQLPLUS divide by zero question
Just taking the opportunity to complain here: Did you know that things like this (appropriate) solution can really waste CPU on the Parallel Query Option ?
If you write:
select sum(a), sum(b), decode (sum(b),0,0,sum(a)/sum(b)) from t;
then the lowest PQ slaves will probably end up running something looking like (doctored for ease of reading).
select /*+ rowid */ sum(a), sum(a), sum(b), sum(b), sum(b) from t where rowid between ......
And it gets worse if you ant a count(distinct colx) in there.
Jonathan Lewis
Jonathan Gennick <gennick_at_worldnet.att.net> wrote in article
> You might try:
>
> select decode (sum(b),0,0,sum(a)/sum(b)) from t;
>
Received on Wed Aug 26 1998 - 02:12:12 CDT
![]() |
![]() |