Re: deleting an identical record

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: missive(at)hotmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: deleting an identical record
Date: 2002-02-21 08:25:02
Message-ID: 1014279902.13240.117.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2002-02-21 at 03:44, Lee Harr wrote:
> > In a table I entered by accident two times the same record, if I now
> > list the table I see two lines with exactly the same contents. How can
> > I delete one of those two records? I can't find a select criterium which
> > differs for both.
> >
>
>
> create table t (a int, b text);
>
> insert into t values (1, 'a');
> insert into t values (1, 'a');
> insert into t values (1, 'a');
> insert into t values (1, 'a');
>
> select oid, * from t;

Aren't the oids different?

DELETE FROM t WHERE oid <> xxx

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C

"My sheep hear my voice, and I know them, and they
follow me; And I give unto them eternal life; and they
shall never perish, neither shall any man pluck them
out of my hand." John 10:27,28

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2002-02-21 08:30:23 Re: OID
Previous Message Kenneth McDowell 2002-02-21 06:26:06 Createdb problems