RE: [HACKERS] Should the following work...?

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: RE: [HACKERS] Should the following work...?
Date: 1999-03-30 18:27:20
Message-ID: Pine.BSF.4.05.9903301425400.55565-100000@thelab.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Using:

select id
from clients
where id = ( select id
from clients
group by id
having count(id) = 1 ) ;

I get:

ERROR: rewrite: aggregate column of view must be at rigth side in qual

On Tue, 30 Mar 1999, Jackson, DeJuan wrote:

> > select id
> > from clients
> > where id = ( select id
> > from clients
> > where count(id) = 1 ) ;
> > The error I get is that you can't do the AGGREGATE int he
> > WHERE clause,
> > but this is with a pre-v6.5 server too...technically, should
> > the above be
> > possible?
> I believe instead of WHERE that should be a HAVING clause.
> But I'm not sure PostgreSQL can handle a HAVING in a sub-select.
>
> -DEJ
>

Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Clark Evans 1999-03-30 18:34:40 Re: [HACKERS] Should the following work...?
Previous Message Andrew Merrill 1999-03-30 18:11:19 Re: [SQL] indexing a datetime by date