Re: Aggregates with NaN values - Mailing list pgsql-sql

From Mark Roberts
Subject Re: Aggregates with NaN values
Date
Msg-id 1228503076.27464.3.camel@localhost
Whole thread Raw
In response to Aggregates with NaN values  ("Sean Davis" <sdavis2@mail.nih.gov>)
Responses Re: Aggregates with NaN values  ("Sean Davis" <sdavis2@mail.nih.gov>)
List pgsql-sql
On Thu, 2008-12-04 at 13:01 -0500, Sean Davis wrote:
> I am happy to see NaN and infinity handled in input.  I would now like
> to compute aggregates (avg, min, max, etc) on columns with NaN values
> in them.  The standard behavior (it appears) is to have the aggregate
> return NaN if the data contain one-or-more NaN values.  I am used to
> using coalesce with NULL values, but that doesn't work with NaN.  I
> can deal with these using CASE statuement to assign a value, but is
> there a standard way of dealing with the NaN (or Infinity, for that
> matter) cases to get a behvavior where they are "ignored" by an
> aggregate?
> 
> Thanks,
> Sean
> 

Have you considered using a where clause?

-Mark



pgsql-sql by date:

Previous
From: "Rafael Domiciano"
Date:
Subject: Re: Trigger/Function - one solution - was constraint question (I think)
Next
From: Bryce Nesbitt
Date:
Subject: Best way to "and" from a one-to-many joined table?