Re: Substitute a Character - Mailing list pgsql-sql

From Andreas Kretschmer
Subject Re: Substitute a Character
Date
Msg-id 20060906170912.GA18152@KanotixBox
Whole thread Raw
In response to Substitute a Character  (Judith <jaltamirano@correolux.com.mx>)
List pgsql-sql
Judith <jaltamirano@correolux.com.mx> schrieb:

>     Hello everybody!!       I have a field type text with folios like this: 
> A98526
> 
>     but I want to change de A for a 0 like this: 098526, exists a way to do 
> this in a query???

Perhaps something like this:

test=# select regexp_replace('A98526', '^.', '0');regexp_replace
----------------098526
(1 row)

http://www.postgresql.org/docs/8.1/interactive/functions-matching.html#FUNCTIONS-POSIX-REGEXP


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


pgsql-sql by date:

Previous
From: Judith
Date:
Subject: Substitute a Character
Next
From: Chris Mair
Date:
Subject: Re: Substitute a Character