RE: [HACKERS] Should the following work...? - Mailing list pgsql-hackers

From Jackson, DeJuan
Subject RE: [HACKERS] Should the following work...?
Date
Msg-id D05EF808F2DFD211AE4A00105AA1B5D2037A50@cpsmail
Whole thread Raw
Responses RE: [HACKERS] Should the following work...?
List pgsql-hackers
> 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


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] vacuum updated...
Next
From: Andrew Merrill
Date:
Subject: Re: [SQL] indexing a datetime by date