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

Поиск
Список
Период
Сортировка
От Brett W. McCoy
Тема Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"
Дата
Msg-id Pine.BSI.3.91.990805131300.14709D-100000@access1.lan2wan.com
обсуждение исходный текст
Ответ на "group, by", problem, when, combined, with, "insert, into"  ("sam smith" <sam_smith20@hotmail.com>)
Ответы Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"
Список 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 по дате отправления:

Предыдущее
От: DE VOLDER Fabrice
Дата:
Сообщение: unsuscribe
Следующее
От: Mike Mascari
Дата:
Сообщение: Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"