| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера