"group, by", problem, when, combined, with, "insert, into" - Mailing list pgsql-general

From sam smith
Subject "group, by", problem, when, combined, with, "insert, into"
Date
Msg-id 19990805053521.67875.qmail@hotmail.com
Whole thread Raw
Responses Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"
List pgsql-general
Hi All

I'm pretty new to postgres and I'm finding soemthing baffling.  I can
perform the following query without a problem -

select loser,count(*) from moves group by loser;

but when i combine it with an insert into -
insert into losses select loser,count(*) from moves group by loser;

I get
ERROR:  Illegal use of aggregates or non-group column in target list

Am I doing something wrong or is it not possible to combine insert into and
group by.

I'm using PostgreSQL 6.5.0

Cheers
Sam


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com

pgsql-general by date:

Previous
From: Michael Simms
Date:
Subject: PQsendQuery
Next
From: DE VOLDER Fabrice
Date:
Subject: unsuscribe