Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into" - Mailing list pgsql-general

From Brett W. McCoy
Subject Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"
Date
Msg-id Pine.BSI.3.91.990805131300.14709D-100000@access1.lan2wan.com
Whole thread Raw
In response to "group, by", problem, when, combined, with, "insert, into"  ("sam smith" <sam_smith20@hotmail.com>)
Responses Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"
List 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


pgsql-general by date:

Previous
From: DE VOLDER Fabrice
Date:
Subject: unsuscribe
Next
From: Mike Mascari
Date:
Subject: Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"