Re: 7.3 "group by" issue

From: "Dan Langille" <dan(at)langille(dot)org>
To: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: 7.3 "group by" issue
Date: 2003-02-21 18:25:56
Message-ID: 3E5628E4.16251.1E808E0F@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 21 Feb 2003 at 19:18, Gaetano Mendola wrote:

> > Hi folks,
> >
> > This query:
> >
> > SELECT element_id as wle_element_id, COUNT(watch_list_id)
> > FROM watch_list JOIN watch_list_element
> > ON watch_list.id = watch_list_element.watch_list_id
> > AND watch_list.user_id = 1
> > GROUP BY watch_list_element.element_id
>
> Try:
>
> SELECT element_id as wle_element_id, COUNT(watch_list_id)
> FROM watch_list JOIN watch_list_element
> ON watch_list.id = watch_list_element.watch_list_id
> WHERE
> watch_list.user_id = 1
> GROUP BY watch_list_element.element_id

ERROR: Attribute unnamed_join.element_id must be GROUPed or used in
an aggregate function

--
Dan Langille : http://www.langille.org/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Chad Thompson 2003-02-21 20:00:55 Re: 7.3 "group by" issue
Previous Message Gaetano Mendola 2003-02-21 18:18:02 Re: 7.3 "group by" issue