Re: Selecting dupes from table - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Selecting dupes from table
Date
Msg-id 20030624112308.GF19206@svana.org
Whole thread Raw
In response to Re: Selecting dupes from table  (Uros <uros@sir-mag.com>)
List pgsql-general
On Tue, Jun 24, 2003 at 01:12:05PM +0200, Uros wrote:
> Hello Martijn,
>
> MvO> select id,url,title from directory,
> MvO> (select url from directory group by url having count(*) > 1) as list
> MvO> where list.url = directory.url;
>
> MvO> I hope I got the syntax right.
>
> I tried that before but got error:
>
> ERROR:  Column reference "url" is ambiguous

Oh right, try:

select id,directory.url,title from directory,
(select url from directory group by url having count(*) > 1) as list
where list.url = directory.url;
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
>   - Samuel P. Huntington

Attachment

pgsql-general by date:

Previous
From: Uros
Date:
Subject: Re: Selecting dupes from table
Next
From: Hervé Piedvache
Date:
Subject: Re: Selecting dupes from table