Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"

Brett W. McCoy <bmccoy@lan2wan.com>

From: "Brett W. McCoy" <bmccoy@lan2wan.com>
To: sam smith <sam_smith20@hotmail.com>
Cc: pgsql-general@hub.org
Date: 1999-08-05T17:19:10Z
Lists: pgsql-general
On Wed, 4 Aug 1999, sam smith wrote:

> 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

I think you want 'select loser, count(*) into losses from moves group by 
loser'

Brett W. McCoy           
                                         http://www.lan2wan.com/~bmccoy
-----------------------------------------------------------------------
Keep Cool, but Don't Freeze
		- Hellman's Mayonnaise