Re: how to do a find and replace

Поиск
Список
Период
Сортировка
От Bricklen Anderson
Тема Re: how to do a find and replace
Дата
Msg-id 437D1862.2060402@PresiNET.com
обсуждение исходный текст
Ответ на how to do a find and replace  (Dawn Buie <dawn@squeegeemedia.com>)
Ответы Re: how to do a find and replace  (Dawn Buie <dawn@squeegeemedia.com>)
Список pgsql-sql
Dawn Buie wrote:
> Hello-
> I'm using postgres 7.4
> 
> I have a column of data with the wrong prefix for many items.
> 
> The wrong entries are entered ' /0/v.myimage.jpg'
> While the correct ones are ' /0/myimage.jpg'
> 
> 
> I need to remove all the 'v.' characters from this column.
> 
> 
> I'm able to do a
> 
> SELECT * FROM myTable
> WHERE location = '%/0/v.%'
> 
> 
> I'm just confused about how I should write code to update the selected
> items to remove the 'v.'
> 
> Would I use substring? An example would be much appreciated.
> 
> thank you
> Dawn

How about update myTable set location=replace(location,'v.','');

-- 
_______________________________

This e-mail may be privileged and/or confidential, and the sender does
not waive any related rights and obligations. Any distribution, use or
copying of this e-mail or the information it contains by other than an
intended recipient is unauthorized. If you received this e-mail in
error, please advise me (by return e-mail or otherwise) immediately.
_______________________________


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

Предыдущее
От: Dawn Buie
Дата:
Сообщение: how to do a find and replace
Следующее
От: Dawn Buie
Дата:
Сообщение: Re: how to do a find and replace