Re: Aggregate Functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Aggregate Functions
Дата
Msg-id 22835.1164000207@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Aggregate Functions  (Yadnyesh Joshi <yadnyesh_joshi@yahoo.com>)
Список pgsql-novice
Yadnyesh Joshi <yadnyesh_joshi@yahoo.com> writes:
> According to the documentation, when "avg" or "stddev" function is used wit=
> h integer arguments, the result is an integer.

Where do you think you read that?

regression=# create table foo(f1 int);
CREATE TABLE
regression=# insert into foo values(1);
INSERT 0 1
regression=# insert into foo values(2);
INSERT 0 1
regression=# insert into foo values(7);
INSERT 0 1
regression=# select avg(f1) from foo;
        avg
--------------------
 3.3333333333333333
(1 row)

regression=# select stddev(f1) from foo;
       stddev
--------------------
 3.2145502536643183
(1 row)

regression=#

            regards, tom lane

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

Предыдущее
От: Yadnyesh Joshi
Дата:
Сообщение: Aggregate Functions
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Aggregate Functions