Обсуждение: Is there a way to remove every character but numbers?

Поиск
Список
Период
Сортировка

Is there a way to remove every character but numbers?

От
Andreas
Дата:
Hi,

I need to clean up a text column so that it just contains numbers or the 
"+" sign if it is the first character of the string.

Well, it is needed to normalise up a phone number column.
So it'd be great if the "+" could be transformed in "00" in the same step.


Re: Is there a way to remove every character but numbers?

От
Viktor Bojović
Дата:


On Sun, Feb 5, 2012 at 2:47 PM, Andreas <maps.on@gmx.net> wrote:
Hi,

I need to clean up a text column so that it just contains numbers or the "+" sign if it is the first character of the string.

Well, it is needed to normalise up a phone number column.
So it'd be great if the "+" could be transformed in "00" in the same step.

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

try regexp_replace


--
---------------------------------------
Viktor Bojović
---------------------------------------
Wherever I go, Murphy goes with me