pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rudi Starcevic <rudi@oasis.net.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Delete duplicates
Date: Mon, 23 Jun 2003 15:39:24 +1000
Message-ID: <3EF6928C.60705@oasis.net.au> (raw)
In-Reply-To: <00ac01c33946$8d1678e0$0a00000a@neo>
References: <20030622091522.M37248@oasis.net.au>
	<2976.200.59.66.253.1056316636.squirrel@webmail.akyasociados.com.ar>
	<00ac01c33946$8d1678e0$0a00000a@neo>

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
>  
>




view thread (10+ messages)  latest in thread

Message-ID: <3EF6928C.60705@oasis.net.au>
Permalink:  ../3EF6928C.60705@oasis.net.au/
Also on:    postgresql.org/message-id/3EF6928C.60705@oasis.net.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rudi@oasis.net.au
  Subject: Re: Delete duplicates
  In-Reply-To: <3EF6928C.60705@oasis.net.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox