Re: How to remove a set of characters in text-columns ?

Поиск
Список
Период
Сортировка
Искать
От
Tim Landscheidt
Тема
Re: How to remove a set of characters in text-columns ?
Дата
Msg-id
m37h82lp64.fsf@passepartout.tim-landscheidt.de
Список
Дерево обсуждения
Re: How to remove a set of characters in text-columns ? Tim Landscheidt <tim@tim-landscheidt.de>
Re: How to remove a set of characters in text-columns ? Andreas <maps.on@gmx.net>
(anonymous) wrote:

> how can I remove a set of characters in text-columns ?
> Say I'd like to remove { } ( ) ' " , ; . : !
> Of course I can chain replace ( replace ( replace ( replace
> ( ... , '' ) .... and replace the chars one by one against
> an empty string ''.

> There might be a more elegant way.
> Is there ?

Besides the regexp_replace() solution mentioned by Charlie
and Steve, you can also use TRANSLATE():

| tim=# SELECT TRANSLATE('a{b''c"d!f', '{}()''",;.:!', '');
|  translate
| -----------
|  abcdf
| (1 Zeile)

| tim=#

Tim


В списке pgsql-sql по дате отправления
От: Charlie
Дата:
От: Andreas
Дата:
FAQ