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

From: Clark Evans <clark(dot)evans(at)manhattanproject(dot)com>
To: The Hermit Hacker <scrappy(at)hub(dot)org>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Should the following work...?
Date: 1999-03-30 18:44:35
Message-ID: 37011B93.22617BEB@manhattanproject.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The Hermit Hacker wrote:
>
> select id
> from clients
> where id = ( select id
> from clients
> where count(id) = 1 ) ;
>

Hmm. If you are trying to identify
duplicate id's then try :

select distinct id from client x
where 1 <
( select count(id)
from client y
where y.id = x.id );

Ideally, this would be done as:

select a from
( select a, count(a) cnt
from test
group by a ) where cnt < 2;

However, PostgreSQL dosn't support
dynamic views. This, btw, is a
very useful feature.

Hope this helps,

Clark

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Clark Evans 1999-03-30 18:47:58 Re: [HACKERS] Should the following work...?
Previous Message The Hermit Hacker 1999-03-30 18:44:34 RE: [HACKERS] Should the following work...?