Re: selecting a column average into table

From: "James McMurry" <jmcmurry(at)pobox(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: selecting a column average into table
Date: 2001-06-12 19:00:27
Message-ID: 002b01c0f371$f2318700$05000100@dorkbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)shawhan(at)ae(dot)ge(dot)com>
To: <pgsql-novice(at)postgresql(dot)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
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Roth 2001-06-12 19:04:28 AW: FATAL ERROR
Previous Message Tom Lane 2001-06-12 13:47:00 Re: [NOVICE] PostgreSQL problem with functions