| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Yadnyesh Joshi <yadnyesh_joshi(at)yahoo(dot)com> |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: Aggregate Functions |
| Date: | 2006-11-20 05:23:27 |
| Message-ID: | 22835.1164000207@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
Yadnyesh Joshi <yadnyesh_joshi(at)yahoo(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Richard Broersma Jr | 2006-11-20 05:43:35 | Re: Aggregate Functions |
| Previous Message | Yadnyesh Joshi | 2006-11-20 05:05:24 | Aggregate Functions |