Re: how to update table to make dup values distinct

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: how to update table to make dup values distinct
Дата
Msg-id 20051111050541.GA22400@wolff.to
обсуждение исходный текст
Ответ на how to update table to make dup values distinct  (george young <gry@ll.mit.edu>)
Список pgsql-sql
On Thu, Nov 10, 2005 at 10:58:18 -0500, george young <gry@ll.mit.edu> wrote:
> [PostgreSQL 7.4RC2 on i686-pc-linux-gnu](I know, I know... must upgrade soon)
> 
> I have a table mytable like:
>  i |  txt  
> ---+-------
>  1 | the
>  2 | the
>  3 | rain
>  4 | in
>  5 | mainly
>  6 | spain
>  7 | stays
>  8 | mainly
>  9 | in
> 
> I want to update it, adding a ':' to txt so that each txt value is unique.
> I don't care which entry gets changed.  I tried:

This seems like an odd way to fix whatever problem you are having.

Assuming you really do want to go through with this, you can use oids to
distinguish rows. For example you could add a colon to the row with the
lowest oid for each repeated string, and keep doing that until you have them
all fixed.


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

Предыдущее
От: "Joel Fradkin"
Дата:
Сообщение: High level discussion for design of using ACL to retrieve Data
Следующее
От: "Gregory S. Williamson"
Дата:
Сообщение: Re: Como ejecutar una funcion insert en plpgsql....