Re: selecting a column average into table - Mailing list pgsql-novice

From James McMurry
Subject Re: selecting a column average into table
Date
Msg-id 002b01c0f371$f2318700$05000100@dorkbox
Whole thread Raw
In response to selecting a column average into table  ("Shawhan, Douglas (GEAE, GECC)" <douglas.shawhan@ae.ge.com>)
List pgsql-novice
This should work:

-- don't have to create the table if you already have one.
create table foo (
    answer float;
)

insert into foo (answer) select avg(numbers) from nebbish;

JM

----- Original Message -----
From: "Shawhan, Douglas (GEAE, GECC)" <douglas.shawhan@ae.ge.com>
To: <pgsql-novice@postgresql.org>
Sent: Tuesday, June 05, 2001 12:19 PM
Subject: [NOVICE] selecting a column average into table


> Weeeellll...
>
> I wish to select the average of a column populated with integers into a
> table
>
> I have established in my mind that:
>
> select avg(nebbish.numbers) into shebang from numbers ;
>
> ain't going to cut it. Can anyone point me in the right direction?
>
> d
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


pgsql-novice by date:

Previous
From: "Nabil Sayegh"
Date:
Subject: Re: How do I start postmaster with -i for tcp-ip
Next
From: Tom Lane
Date:
Subject: Re: AW: FATAL ERROR