Re: search/replace in update

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: search/replace in update
Дата
Msg-id web-71932@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на search/replace in update  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
Список pgsql-sql
Gary,

> This means that e.g. all mobile numbers that used to start 0589 now 
> start 07889.
> 
> Is there a way in SQL to update the phone number in-place?

Postgresql has a nifty string substitution function.  For this and other
character manipulation functions, see:

http://www.postgresql.org/idocs/index.php?functions-string.html

You should be able to fairly easily swap out "07889" and replace it with
"0589".

-Josh



______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


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

Предыдущее
От: Vivek Khera
Дата:
Сообщение: Re: Timestamp without time zone
Следующее
От: Alex Pilosov
Дата:
Сообщение: Re: Re: Timestamp without time zone