Re: Aggregate Functions - Mailing list pgsql-novice

From A. Kretschmer
Subject Re: Aggregate Functions
Date
Msg-id 20061120060653.GA27960@a-kretschmer.de
Whole thread Raw
In response to Aggregate Functions  (Yadnyesh Joshi <yadnyesh_joshi@yahoo.com>)
List 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 by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Aggregate Functions
Next
From: "Shivin M"
Date:
Subject: Using seq. objects with COPY FROM?