Re: Duplicate Row Removal

From: "Dean Gibson (DB Administrator)" <postgresql4(at)ultimeth(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Duplicate Row Removal
Date: 2005-11-05 06:34:39
Message-ID: 436C527F.70400@ultimeth.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-general

CREATE TABLE new_name AS SELECT DISTINCT * FROM old_name;

DROP TABLE old_name;

ALTER TABLE new_name RENAME TO old_name;

On 2005-11-04 17:15, Peter Atkins wrote:
> All,
>
> I have a duplicate row problem and to make matters worse some tables don't have a PK or any unique identifier.
>
> Anyone have any thoughts on how to remove dups?

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Andreas Pflug 2005-11-05 07:31:50 Re: RC1 gets crashed.
Previous Message Tom Lane 2005-11-05 06:24:21 Re: Duplicate Row Removal

Browse pgsql-general by date

  From Date Subject
Next Message Michal Hlavac 2005-11-05 09:42:17 Re: Postgresql connection on suse 10
Previous Message Tom Lane 2005-11-05 06:24:21 Re: Duplicate Row Removal