Re: Delete duplicated rows

From: papapep <papapep(at)gmx(dot)net>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Delete duplicated rows
Date: 2003-08-04 17:27:33
Message-ID: 3F2E9785.9070106@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks to all for your answer (including Duncan that has replied to my
private mailbox), but I think all of them are thinking of removing rows
that have one field that is repeated in other rows.
My problem is that the WHOLE row is repeated, so I have to find
something like this:

FIELDS 1 2 3 4 5 6 7
Row 1 my car is blue and very fast *
Row 2 your car is green and quite fast
Row 3 my car is blue and very fast *
Row 4 my car is blue and very big
Row 5 my car is red and very fast
Row 6 my car is blue and very fast *

* Totally duplicated rows

What do you think about making a query trying to get only the no
duplicated rows, insert them in a temporary table and after deleting all
the rows from the original table reinsert the temporary table's rows
into the empty one?? Perhaps is a little bit silly, but it's the only
way I see....

Thanks once again.

Josep Sànchez
[papapep]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/LpeE2vx52x0kyz4RAvzqAKC1pA27F1u/mzoPs6BY1bFgaGQk6wCeL40U
whmWGXWGT56Ec61vC81yorA=
=exh7
-----END PGP SIGNATURE-----

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Francisco J Reyes 2003-08-04 17:34:21 Re: Migration from MySQL, some difficulties with DESCRIBE
Previous Message Nabil Sayegh 2003-08-04 16:53:38 Re: merging 2 dumps / dumping only 1 schema