Re: [GENERAL] Illegal use of aggregates or non-group column in target list

From: "G(dot) Anthony Reina" <reina(at)nsi(dot)edu>
To: Jason <neumeier(at)bright(dot)net>, "pgsql-general(at)hub(dot)org" <pgsql-general(at)hub(dot)org>
Subject: Re: [GENERAL] Illegal use of aggregates or non-group column in target list
Date: 2000-03-03 18:53:41
Message-ID: 38C00A35.355FE9@nsi.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jason wrote:

> select target, avg(reaction_time) from data_table GROUP BY target;
>
> That should do it.
>
> -Jason.
>

Wow! That works great. Thanks Jason.

It's interesting that "select target, avg(reaction_time) from data_table
GROUP BY target;" works but not "select target, avg(reaction_time) from
data_table;".

Doesn't the parser automatically group by the first variable returned?

-Tony

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Abdelkrim WAHHABI 2000-03-03 19:03:06 system crash
Previous Message G. Anthony Reina 2000-03-03 18:14:58 Illegal use of aggregates or non-group column in target list