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

From G. Anthony Reina
Subject Re: [GENERAL] Illegal use of aggregates or non-group column in target list
Date
Msg-id 38C00A35.355FE9@nsi.edu
Whole thread Raw
Responses Re: [GENERAL] Illegal use of aggregates or non-group column in target list
List 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



pgsql-general by date:

Previous
From: "G. Anthony Reina"
Date:
Subject: Illegal use of aggregates or non-group column in target list
Next
From: Chris Jones
Date:
Subject: database corruption?