pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Is there a way to remove every character but numbers?
2+ messages / 2 participants
[nested] [flat]

* Is there a way to remove every character but numbers?
@ 2012-02-05 13:47 Andreas <maps.on@gmx.net>
  2012-02-05 13:56 ` Re: Is there a way to remove every character but numbers? Viktor Bojović <viktor.bojovic@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Andreas @ 2012-02-05 13:47 UTC (permalink / raw)
  To: pgsql-sql

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.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Is there a way to remove every character but numbers?
  2012-02-05 13:47 Is there a way to remove every character but numbers? Andreas <maps.on@gmx.net>
@ 2012-02-05 13:56 ` Viktor Bojović <viktor.bojovic@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Viktor Bojović @ 2012-02-05 13:56 UTC (permalink / raw)
  To: Andreas <maps.on@gmx.net>; +Cc: pgsql-sql

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<http://www.postgresql.org/mailpref/pgsql-sql;
>

try regexp_replace


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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-02-05 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-02-05 13:47 Is there a way to remove every character but numbers? Andreas <maps.on@gmx.net>
2012-02-05 13:56 ` Viktor Bojović <viktor.bojovic@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox