Re: No stddev() for interval?

Поиск
Список
Период
Сортировка
От Brendan Jurd
Тема Re: No stddev() for interval?
Дата
Msg-id 37ed240d0605201427s11a72763kf1222f6f2073082f@mail.gmail.com
обсуждение исходный текст
Ответ на Re: No stddev() for interval?  (David Fetter <david@fetter.org>)
Ответы Re: No stddev() for interval?  ("Nikolay Samokhvalov" <samokhvalov@gmail.com>)
Список pgsql-general

That's because variance of foo is measured in foo^2 units.  What is
the square of an interval?

Cheers,
D

Well if you're willing to accept that for the purposes of computing the aggregates, an interval "month" is equal to 30 days (which is how avg(interval) already works), then an interval is reducable to a single quantity -- a number of seconds -- which can be squared.

30 days per month is pretty rough ... we could refine it to 30.4375, which is the average number of days per month over four years including one leap year.

В списке pgsql-general по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: No stddev() for interval?
Следующее
От: "Nikolay Samokhvalov"
Дата:
Сообщение: Re: No stddev() for interval?