Re: select first occurrence of a table

Поиск
Список
Период
Сортировка
От Erik Ronström
Тема Re: select first occurrence of a table
Дата
Msg-id 20030502173308.44115.qmail@web13806.mail.yahoo.com
обсуждение исходный текст
Ответ на select first occurrence of a table  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
Ответы Re: select first occurrence of a table  (Tom Lane <tgl@sss.pgh.pa.us>)
Status of OIDs was: Re: select first occurrence of a table  (Benjamin Scherrey <scherrey@proteus-tech.com>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Erik Ronström
Дата:
Сообщение: Re: select first occurrence of a table
Следующее
От: nolan@celery.tssi.com
Дата:
Сообщение: Re: select first occurrence of a table