Re: GROUP by - Mailing list pgsql-sql

From Jesus Aneiros
Subject Re: GROUP by
Date
Msg-id Pine.LNX.4.10.10007050745420.28780-100000@jagua.cfg.sld.cu
Whole thread Raw
In response to GROUP by  (Antti Linno <alligator@all.ee>)
List 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
> 
> 



pgsql-sql by date:

Previous
From: "Gerhard Dieringer"
Date:
Subject: Antw: GROUP by
Next
From: "tjk@tksoft.com"
Date:
Subject: Re: Group BY ...(cont.)