Re: stddev returns 0 when there is one row

From: nolan(at)celery(dot)tssi(dot)com
To: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Re: stddev returns 0 when there is one row
Date: 2003-04-19 20:54:41
Message-ID: 20030419205441.22967.qmail@celery.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Welche 2003-04-19 23:18:30 Re: explain ?
Previous Message Bruno Wolff III 2003-04-19 20:36:31 Re: stddev returns 0 when there is one row