select first occurrence of a table

Поиск
Список
Период
Сортировка
От Johnson, Shaunn
Тема select first occurrence of a table
Дата
Msg-id 73309C2FDD95D11192E60008C7B1D5BB05FED241@snt452.corp.bcbsm.com
обсуждение исходный текст
Ответы Re: select first occurrence of a table  ("scott.marlowe" <scott.marlowe@ihs.com>)
Re: select first occurrence of a table  (Erik Ronström <kvarken@yahoo.com>)
Re: select first occurrence of a table  (Erik Ronström <kvarken@yahoo.com>)
Re: select first occurrence of a table  (Dennis Gearon <gearond@cvc.net>)
Список pgsql-general

Have a general SQL question:

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.

For example: I have a table that looks like this

[snip table]

           Table "survey_processed_dt"
    Column      |         Type                  | Modifiers
-------------------+---------------------------+-----------
 survid         | character(8)          |
 processed_id | character varying(2)    |
 processed_dt | date                    |

[/snip table]

And the rows look like this:

[snip rows]

bcn=> select * from survey_processed_dt where survid = '02021000' and processed_id = '05';
  survid  | processed_id | processed_dt
----------+--------------+--------------
 02021000 | 05           | 2003-01-16
 02021000 | 05           | 2003-01-16
(2 rows)

[/snip rows]

I want to change ONE of the rows ... is there a way to
just select the first occurrence of a row to update?

Suggestions?

Thanks!

-X

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: TIMEZONE Problem
Следующее
От: "Ivan"
Дата:
Сообщение: bytea data