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




---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to