Re: select first occurrence of a table

From: Erik Ronström <kvarken(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: select first occurrence of a table
Date: 2003-05-02 17:07:11
Message-ID: 20030502170711.36079.qmail@web13808.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I have a table that happens to have a some
> duplicate entries in it (entire rows). I would like
> to update one row and change one thing
> about it, but it seems that I need a unique value
> to do it; otherwise, I wind up changing multiple
> rows.

If the table has OIDs (which is the default), you can use the OID as a
unique identifier for a row. But then you'll have to perform two
queries:

SELECT oid FROM table WHERE ... LIMIT 1;

UPDATE table SET ... WHERE oid = ...;

Erik

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erik Ronström 2003-05-02 17:33:08 Re: select first occurrence of a table
Previous Message Ivan 2003-05-02 16:58:03 bytea data