Re: Delete duplicates

From: Rudi Starcevic <rudi(at)oasis(dot)net(dot)au>
To:
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Delete duplicates
Date: 2003-06-23 05:39:24
Message-ID: 3EF6928C.60705@oasis.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Would this be OK or a little crude (untested) :

INSERT INTO new_table ( id, something )
SELECT
DISTINCT ON (id)
id,
something
FROM old_table
ORDER BY id

Or something similar but create a new table ?

Cheers
Rudi.

Denis Arh wrote:

>How to delete "real" duplicates?
>
>id | somthing
>-----------------------
>1 | aaa
>1 | aaa
>2 | bbb
>2 | bbb
>
>(an accident with backup recovery...)
>
>
>
>Regards,
>Denis Arh
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Anagha Joshi 2003-06-23 05:42:02 Urgent Help : Use of return from function/procedure.
Previous Message Sean Chittenden 2003-06-23 05:22:56 Re: Delete duplicates