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

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"
Дата
Msg-id 19990805093523.3067.rocketmail@web106.yahoomail.com
обсуждение исходный текст
Список pgsql-general
I believe previous versions actually allowed you
to (if memory serves), but the developers currently
disabled this statement because it could sometimes
cause incorrect results.  At:

    http://www.postgresql.org/docs/todo.html

you'll find several references to this problem:

* -INSERT ... SELECT ... GROUP BY groups by target
  columns not source columns

* redesign INSERT ... SELECT to have two levels of
  target list

Hope that helps,

Mike Mascari (mascarim@yahoo.com)

--- sam smith <sam_smith20@hotmail.com> wrote:
> 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
>

_____________________________________________________________
Do You Yahoo!?
Free instant messaging and more at http://messenger.yahoo.com


В списке pgsql-general по дате отправления:

Предыдущее
От: "Brett W. McCoy"
Дата:
Сообщение: Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: [GENERAL] "group, by", problem, when, combined, with, "insert, into"