Received: from leela.one-2-one.net (leela.one-2-one.net [217.115.142.65]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAU7rWm53482 for ; Fri, 30 Nov 2001 02:53:32 -0500 (EST) (envelope-from twanger@bluetwanger.de) Received: from [192.168.0.14] (pD90557D4.dip.t-dialin.net [217.5.87.212]) by leela.one-2-one.net (8.11.0/8.11.0) with ESMTP id fAU7rQe08432; Fri, 30 Nov 2001 08:53:26 +0100 Subject: Re: contracting tables From: Markus Bertheau To: "Peter T. Brown" Cc: postgres sql list In-Reply-To: <00e001c17930$aa8af8b0$7d00000a@PETER> References: <00e001c17930$aa8af8b0$7d00000a@PETER> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-zx+KoiZxPhknYJlQ8sUn" X-Mailer: Evolution/0.99.2 (Preview Release) Date: 30 Nov 2001 08:53:28 +0100 Message-Id: <1007106809.1107.11.camel@entwicklung01.cenes.de> Mime-Version: 1.0 X-Archive-Number: 200111/430 X-Sequence-Number: 5812 --=-zx+KoiZxPhknYJlQ8sUn Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2001-11-30 at 00:50, Peter T. Brown wrote: > I have a table with many records, some of which are duplicates (there is = no > unique constraints). How can I contract this table to remove any of these > duplicate records? Like when using GROUP BY in a select statement, except > that I want to just remove the extra entries from this table directly... = Any > ideas? If I understood you right, one problem is to identify only one row of a duplicate. There is a 'hidden' field oid in every table that is unique. It goes like this:=20 select oid, * from So you could delete the rows by oid: delete from where oid =3D HTH Markus Bertheau --=-zx+KoiZxPhknYJlQ8sUn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQA8Bzr4KNEjAb345r4RAji+AJ9QvfbTilh+lqNtIVejXF37GVz2CACfRRSk LwPALH8g3i/sVknmv+OFY8k= =ixRa -----END PGP SIGNATURE----- --=-zx+KoiZxPhknYJlQ8sUn--