pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: Dan Langille <dan@langille.org>
To: pgsql-sql@postgresql.org
Subject: Re: 7.3 "group by" issue
Date: Fri, 21 Feb 2003 19:18:02 +0100
Message-ID: <008a01c2d9d5$92d59ed0$152aa8c0@GMENDOLA2> (raw)
References: <3E56231A.22301.1E69F0EA@localhost>

----- Original Message ----- 
From: "Dan Langille" <dan@langille.org>
To: <pgsql-sql@postgresql.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




view thread (14+ messages)  latest in thread

Message-ID: <008a01c2d9d5$92d59ed0$152aa8c0@GMENDOLA2>
Permalink:  ../008a01c2d9d5$92d59ed0$152aa8c0@GMENDOLA2/
Also on:    postgresql.org/message-id/008a01c2d9d5$92d59ed0$152aa8c0@GMENDOLA2

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mendola@bigfoot.com, dan@langille.org
  Subject: Re: 7.3 "group by" issue
  In-Reply-To: <008a01c2d9d5$92d59ed0$152aa8c0@GMENDOLA2>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox