Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f63H3Pa67620 for ; Tue, 3 Jul 2001 13:03:25 -0400 (EDT) (envelope-from dev@archonet.com) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 2.12 #1) id 15HTay-000CHh-0V; Tue, 3 Jul 2001 18:04:17 +0100 Received: from client (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with SMTP id 72B091454A; Tue, 3 Jul 2001 17:20:18 +0100 (BST) Message-ID: <005201c103dc$0b82e260$1001a8c0@archonet.com> From: "Richard Huxton" To: "Ross J. Reedstrom" , "ibrahim cobanoglu" , References: <20010703102342.89388.qmail@web14406.mail.yahoo.com> <20010703094709.A31594@rice.edu> Subject: Re: Re: pls Help us... (sql question) Date: Tue, 3 Jul 2001 17:19:13 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200107/22 X-Sequence-Number: 3803 From: "Ross J. Reedstrom" > Best to ask your questions on the list, so others may find them, > with (hopefully) helpful answers in the archives in the future. > > so, you've got a table with indistinguishable rows. I'm afraid you've > got to use an non ANSI extension. Every DB I've ever used has something > equivelant. In PostgreSQL, it's the 'oid', so in your case, you'd do: > > SELECT oid,Name from tablename; > > and see something like: > oid Name > ------- ------- > 102453 ibrahim first row > 102455 ibrahim second row > 103756 ibrahim third row > > > Then, you can delete, comparing on the oid: > > DELETE FROM tablename WHERE oid=102455; Ibrahim - if you want to prevent any more duplicate entries you can make the "name" column unique - see the CREATE TABLE docs but it would be something like: CREATE TABLE tablename ( "Name" varchar(64) UNIQUE; ); Then PG will fail any attempt to insert a duplicate value (it is the same as creating a UNIQUE index basically). - Richard Huxton