Re: Delete 1 Record of 2 Duplicate Records

From: greg(at)turnstep(dot)com
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Delete 1 Record of 2 Duplicate Records
Date: 2003-01-30 15:04:20
Message-ID: 07f0833692070125b9317094e7008b4f@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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

If they are truly identical, then you must use the hidden 'oid' column to
differentiate the two. No need to peek at the oid, just do this:

DELETE FROM test WHERE oid = (SELECT oid FROM test WHERE column_id=5 LIMIT 1);

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200301301006

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE+OT+AvJuQZxSWSsgRAgZOAKCrwW2O/bQpxo5LBBp4vDkS8YoZ9wCg2H7N
R9R4CTSXx/lRmjm5NvZkYXE=
=VI0G
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tambet Matiisen 2003-01-30 15:15:03 Re: Function executing twice
Previous Message Tom Lane 2003-01-30 14:56:04 Re: Filter function