Re: Aggregate Functions - Mailing list pgsql-novice

From Tom Lane
Subject Re: Aggregate Functions
Date
Msg-id 22835.1164000207@sss.pgh.pa.us
Whole thread Raw
In response to Aggregate Functions  (Yadnyesh Joshi <yadnyesh_joshi@yahoo.com>)
List 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 by date:

Previous
From: Yadnyesh Joshi
Date:
Subject: Aggregate Functions
Next
From: Richard Broersma Jr
Date:
Subject: Re: Aggregate Functions