X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 069A69FB332 for ; Wed, 6 Sep 2006 14:16:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 60208-02 for ; Wed, 6 Sep 2006 14:16:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from my.endian.it (unknown [62.146.87.34]) by postgresql.org (Postfix) with ESMTP id A20C89FB3D0 for ; Wed, 6 Sep 2006 14:14:41 -0300 (ADT) Received: from ultra.home.lan (host170-230.pool875.interbusiness.it [87.5.230.170]) (authenticated (0 bits)) by my.endian.it (8.11.6/8.11.6) with ESMTP id k86HNmT01021; Wed, 6 Sep 2006 19:23:48 +0200 Subject: Re: Substitute a Character From: Chris Mair To: Judith Cc: pgsql-sql@postgresql.org In-Reply-To: <44FEFCFA.8010501@correolux.com.mx> References: <44FEFCFA.8010501@correolux.com.mx> Content-Type: text/plain Date: Wed, 06 Sep 2006 19:14:37 +0200 Message-Id: <1157562877.25934.1.camel@ultra.home.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 (2.6.3-1.fc5.5) Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.175 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/37 X-Sequence-Number: 26248 > 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