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 20030419205441.22967.qmail@celery.tssi.com
Whole thread Raw
In response to stddev returns 0 when there is one row  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
> So I'd take it that PostgreSQL's STDDEV implements STDDEV_POP.

A simple test (3 rows, values 1, 2, and 3) shows that pgsql uses the
sample (N-1) formulas for variance and standard deviation, not the
population (N) formulas.

Oracle, which also implements the sample formulas, specifically defines
the variance to be 0 when there is just one row.
--
Mike Nolan


pgsql-general by date:

Previous
From: Robert Treat
Date:
Subject: Re: 7.3 PDF documentation
Next
From: Patrick Welche
Date:
Subject: Re: explain ?