Michael Höller wrote:

> Hello,
> 
> I initially thought this is simple.. I want to relpace a character to
> nothing. Eg. relace "B" to "" ->  ABCD to ACD.
> 
> All me approches vaild but I am sure that I have seen it already and
> think it was not tricky..
> 
> Can someone please help me ?

From the manual:

replace(string text, from text, to text) returns text
  Replace all occurrences in string of substring from with substring to.

<http://www.postgresql.org/docs/8.0/interactive/functions-string.html>

To replace only on output, for example:

SELECT replace (sometextcolumn, from 'B', to '') FROM sometable;

To replace the data,

UPDATE sometable SET sometextcolumn = replace (sometextcolumn, from 'B', to '');

HTH,
Owen

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to