| От | Andrew Chambers |
|---|---|
| Тема | Re: Finding and replacing text within records |
| Дата | |
| Msg-id | 20060118004152.GA25166@yapgi обсуждение исходный текст |
| Ответ на | Finding and replacing text within records (Lynna Landstreet <lynna@spidersilk.net>) |
| Список | pgsql-novice |
On 17:09 Tue 17 Jan , Lynna Landstreet wrote: > Hello, > > I'm wondering if there is a way in SQL to find and replace a specific string > within various database records, the way you might across a text document. > Not to replace the entire value of the fields in which the string is found, > but just that specific string. http://www.postgresql.org/docs/8.1/static/functions-matching.html#FUNCTIONS-POSIX-REGEXP [snip] > So is there a way to search out all occurrences of, say, > the string "testsite.mydomain.com" within a specific column and change > it to "www.theirdomain.com" wherever it's found? regexp_replace(field, 'testsite\.mydomain\.com', 'www\.theirdomain\.com' [,flags]) Regards, Andy
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера