Re: stddev returns 0 when there is one row - Mailing list pgsql-general

From nolan@celery.tssi.com
Subject Re: stddev returns 0 when there is one row
Date
Msg-id 20030421174134.7748.qmail@celery.tssi.com
Whole thread Raw
In response to stddev returns 0 when there is one row  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: stddev returns 0 when there is one row  (Joe Conway <mail@joeconway.com>)
Re: stddev returns 0 when there is one row  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> I'm not volunteering, no.  (For starters, I think you'd need to upgrade
> the aggregate code to allow multiple-input aggregates.  Which is worth
> doing, but I do not expect to have time to think about such things for
> 7.4.)

Having multiple-input aggregates opens up possibilites for a large number
of multivariate statistical measures, either built in or as user-defined
functions.  (He says as he works on formatting output from an Oracle DBMS
for time-series analysis via SPSS or SAS.)

I guess I don't understand the point of the count(*) parameter, but
wouldn't the easiest way to offer both sample and population formulas for
variance and standard deviation be to just add two new functions,
varp and stddevp, most of the code for which already exists?

That way they remain single-input aggregates.

(A perfectionist would also include vars and stddevs as equivalents to
the existing var and stddev functions.)
--
Mike Nolan


pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: Documentation
Next
From: "enediel"
Date:
Subject: postgresql doesn't start