pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Mair <chrisnospam@1006.org>
To: Judith <jaltamirano@correolux.com.mx>
Cc: pgsql-sql@postgresql.org
Subject: Re: Substitute a Character
Date: Wed, 06 Sep 2006 19:14:37 +0200
Message-ID: <1157562877.25934.1.camel@ultra.home.lan> (raw)
In-Reply-To: <44FEFCFA.8010501@correolux.com.mx>
References: <44FEFCFA.8010501@correolux.com.mx>


>     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???
> 
>     Thanks in advanced!!!

You should look at these functions:
http://www.postgresql.org/docs/8.1/static/functions-string.html

This for example might work for you:
select translate('A98526', 'A', '0');

Bye, Chris.


-- 

Chris Mair
http://www.1006.org




view thread (5+ messages)  latest in thread

Message-ID: <1157562877.25934.1.camel@ultra.home.lan>
Permalink:  ../1157562877.25934.1.camel@ultra.home.lan/
Also on:    postgresql.org/message-id/1157562877.25934.1.camel@ultra.home.lan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: chrisnospam@1006.org, jaltamirano@correolux.com.mx
  Subject: Re: Substitute a Character
  In-Reply-To: <1157562877.25934.1.camel@ultra.home.lan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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