pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-sql@postgresql.org
Subject: Re: Substitute a Character
Date: Wed, 6 Sep 2006 19:09:12 +0200
Message-ID: <20060906170912.GA18152@KanotixBox> (raw)
In-Reply-To: <44FEFCFA.8010501@correolux.com.mx>
References: <44FEFCFA.8010501@correolux.com.mx>

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°



view thread (5+ messages)  latest in thread

Message-ID: <20060906170912.GA18152@KanotixBox>
Permalink:  ../20060906170912.GA18152@KanotixBox/
Also on:    postgresql.org/message-id/20060906170912.GA18152@KanotixBox

 · 

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: akretschmer@spamfence.net
  Subject: Re: Substitute a Character
  In-Reply-To: <20060906170912.GA18152@KanotixBox>

* 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