Re: group by problem

From: Vashenko Maxim <max(at)nino(dot)ru>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: group by problem
Date: 2000-06-15 11:23:12
Message-ID: 3948BCA0.E712AC73@nino.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthias Teege wrote:
>
> Moin,
>
> i have an sql query which works perfect under PostgrSQL
> 6.0 but under 6.5.1 it brings: ERROR: Illegal use of
> aggregates or non-group column in target list.
>
> select T1.id, T1.name, T1.zusatz, T1.kontakt, T1.strasse,
> T1.land, T1.plz, T1.ort, T1.telefax
> from debitoren T1, auftrag T2
> where T2.kunde=T1.id
> group by T1.id;
>
> Where is the problem?

Write:

group by T1.id, T1.name, T1.zusatz, T1.kontakt, T1.strasse,
T1.land, T1.plz, T1.ort, T1.telefax

IMHO you must 'group' on all selected rows by except
aggregated rows.

With best regards, Max Vaschenko,
Nizhny Novgorod Information Networks.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vashenko Maxim 2000-06-15 11:25:24 Re: count & distinct
Previous Message Andrew Snow 2000-06-15 10:53:42 RE: count & distinct