Re: Selecting dupes from table

From: Uros <uros(at)sir-mag(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Selecting dupes from table
Date: 2003-06-24 11:12:05
Message-ID: 1948949269.20030624131205@sir-mag.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Martijn,

Tuesday, June 24, 2003, 12:32:53 PM, you wrote:

MvO> On Tue, Jun 24, 2003 at 12:16:43PM +0200, Uros wrote:

MvO> How about:

MvO> Duplicate urls would be given by:

MvO> select url from directory group by url having count(*) > 1;

MvO> To get all the entries with those urls, something like:

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

--
Best regards,
Uros mailto:uros(at)sir-mag(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2003-06-24 11:23:09 Re: Selecting dupes from table
Previous Message Justin Clift 2003-06-24 11:01:27 Re: interesting PHP/MySQL thread