Re: 7.3 "group by" issue

From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: "Dan Langille" <dan(at)langille(dot)org>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: 7.3 "group by" issue
Date: 2003-02-21 18:18:02
Message-ID: 008a01c2d9d5$92d59ed0$152aa8c0@GMENDOLA2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

----- Original Message -----
From: "Dan Langille" <dan(at)langille(dot)org>
To: <pgsql-sql(at)postgresql(dot)org>
Sent: Friday, February 21, 2003 7:01 PM
Subject: [SQL] 7.3 "group by" issue

> 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

Ciao
Gaetano

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dan Langille 2003-02-21 18:25:56 Re: 7.3 "group by" issue
Previous Message Dan Langille 2003-02-21 18:01:14 7.3 "group by" issue