Re: GROUP by

From: Jesus Aneiros <aneiros(at)jagua(dot)cfg(dot)sld(dot)cu>
To: Antti Linno <alligator(at)all(dot)ee>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: GROUP by
Date: 2000-07-05 11:52:28
Message-ID: Pine.LNX.4.10.10007050745420.28780-100000@jagua.cfg.sld.cu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

You can use group by without having an aggregate operator but if you use
an aggregate you have to put the group by column int the select.

By the way what is after the AND? I hope it is not another workgroup
condition because it doesn't have much sense, I think. If you are
filtering different types of workgroup you should use OR.

Jesus.

On Wed, 5 Jul 2000, Antti Linno wrote:

> I have table job, and I want to select data from it, grouping by
> workgroups. When I use
> select id,name from job where workgroup='top leaders' AND ... group by
> workgroup;
> When I want to group, I get
> ERROR: Illegal use of aggregates or non-group column in target list
> I'm confused, why does query work only with sum,min etc. alone in
> select.
>
> Antti
>
>

In response to

  • GROUP by at 2000-07-05 11:14:55 from Antti Linno

Browse pgsql-sql by date

  From Date Subject
Next Message Antti Linno 2000-07-05 12:01:44 Group BY ...(cont.)
Previous Message Jerome Alet 2000-07-05 11:50:44 Re: GROUP by