Re: Aggregate Functions

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: Aggregate Functions
Дата
Msg-id 20061120060653.GA27960@a-kretschmer.de
обсуждение исходный текст
Ответ на Aggregate Functions  (Yadnyesh Joshi <yadnyesh_joshi@yahoo.com>)
Список pgsql-novice
am  Sun, dem 19.11.2006, um 21:05:24 -0800 mailte Yadnyesh Joshi folgendes:
> According to the documentation, when "avg" or "stddev" function is used with
> integer arguments, the result is an integer. How can I obtain floating point

Thats not true:

test=> create table ints (i int);
CREATE TABLE
test=*> insert into ints values (2);
INSERT 0 1
test=*> insert into ints values (3);
INSERT 0 1
test=*> select avg(i) from ints;
        avg
--------------------
 2.5000000000000000
(1 row)

test=*> select stddev(i) from ints;
         stddev
------------------------
 0.70710678118654752440
(1 row)


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

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

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Aggregate Functions
Следующее
От: "Shivin M"
Дата:
Сообщение: Using seq. objects with COPY FROM?