X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AC67FDB600 for ; Thu, 17 Nov 2005 19:55:49 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85619-02 for ; Thu, 17 Nov 2005 23:55:52 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from presinet.com (presinet.com [209.53.156.1]) by svr1.postgresql.org (Postfix) with ESMTP id 7DD89DB466 for ; Thu, 17 Nov 2005 19:55:46 -0400 (AST) Received: from [10.10.1.151] ([10.10.1.151]) by presinet.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 17 Nov 2005 15:53:26 -0800 Message-ID: <437D1862.2060402@PresiNET.com> Date: Thu, 17 Nov 2005 15:55:14 -0800 From: Bricklen Anderson User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dawn Buie CC: pgsql-sql@postgresql.org Subject: Re: how to do a find and replace References: <1132269492.30942.20.camel@dev11dt.corp.localmatters.com> <5d001d303f001ea0847254c3f0a352d9@squeegeemedia.com> In-Reply-To: <5d001d303f001ea0847254c3f0a352d9@squeegeemedia.com> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 17 Nov 2005 23:53:26.0671 (UTC) FILETIME=[1A4B01F0:01C5EBD2] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/140 X-Sequence-Number: 23391 Dawn Buie wrote: > Hello- > I'm using postgres 7.4 > > I have a column of data with the wrong prefix for many items. > > The wrong entries are entered ' /0/v.myimage.jpg' > While the correct ones are ' /0/myimage.jpg' > > > I need to remove all the 'v.' characters from this column. > > > I'm able to do a > > SELECT * FROM myTable > WHERE location = '%/0/v.%' > > > I'm just confused about how I should write code to update the selected > items to remove the 'v.' > > Would I use substring? An example would be much appreciated. > > thank you > Dawn How about update myTable set location=replace(location,'v.',''); -- _______________________________ This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately. _______________________________