Skip site navigation (1) Skip section navigation (2)

Re: Aggregates with NaN values

From: Mark Roberts <mailing_lists(at)pandapocket(dot)com>
To: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
Cc: pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Aggregates with NaN values
Date: 2008-12-05 18:51:16
Message-ID: 1228503076.27464.3.camel@localhost (view raw or flat)
Thread:
Lists: 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


In response to

Responses

pgsql-sql by date

Next:From: Bryce NesbittDate: 2008-12-05 18:55:23
Subject: Best way to "and" from a one-to-many joined table?
Previous:From: Rafael DomicianoDate: 2008-12-04 19:59:55
Subject: Re: Trigger/Function - one solution - was constraint question (I think)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group