Re: Compute AVG and excluding 0 values

From: Carlos Augusto Leite Netto <cnetto_at_cps.softex.br>
Date: 1996/03/29
Message-ID: <315B9F57.5F3C_at_cps.softex.br>#1/1


Yoram zilberberg wrote:
>
> Looks like you should have used NULL instaed of 0.
> think about it ...
>
> In Article<4ifqdp$2jn_at_nnrp1.news.primenet.com>, <mcclure_at_primenet.com> write:
> > Path:
> > Is there anyway to exclude rows with 0 values from a "compute avg on"
> > statement?

what about:

compute avg of trick on report
break on report

select "your columns", decode( that_column, 0, null, that_column ) trick from ...

You can also try:

select avg( decode( ... same above ... ) ) from ...

Enjoy,

Carlos Netto
cnetto_at_cps.softex.br Received on Fri Mar 29 1996 - 00:00:00 CET

Original text of this message