From: Baron Schwartz Date: September 5 2007 1:30am Subject: Re: Editing fields in bulk List-Archive: http://lists.mysql.com/mysql/208914 Message-Id: <46DE06B4.3050105@xaprb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Brian Dunning wrote: > I have a column where I need to replace all instances of the text > "US-Complete" (contained within a long sentence) with "US Complete". > There are probably 50 or 100 of them. I'm really scared to do it since I > can't risk screwing up that column - what's the correct syntax? UPDATE tbl SET col=REPLACE(col, 'US-Complete', 'US Complete'); If there are spaces in front and back, perhaps you should add some extra insurance to avoid changing 'US-Completely' or 'BUS-Complete' as well: UPDATE tbl SET col=REPLACE(col, ' US-Complete ', ' US Complete '); The best insurance is to do a SELECT first to see what will be changed: SELECT col, REPLACE(col, 'US-Complete', 'US Complete') FROM tbl; Baron