List:General Discussion« Previous MessageNext Message »
From:Hartleigh Burton Date:September 5 2007 1:14am
Subject:RE: Editing fields in bulk
View as plain text  
I could use the same thing... just looking through the documentation there
is a replace() function. Maybe do a backup/restore to a test database before
doing this on your live system...

UPDATE `tablename` SET `fieldname`=REPLACE(tablename.fieldname,'US-
Complete','US Complete') WHERE `fieldname` LIKE '%US- Complete%';





-----Original Message-----
From: Brian Dunning [mailto:brian@stripped] 
Sent: Wednesday, 5 September 2007 10:42 AM
To: mysql@stripped
Subject: Editing fields in bulk

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?

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=1


No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.5/989 - Release Date: 4/09/2007
5:54 PM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.5/989 - Release Date: 4/09/2007
5:54 PM
 

Thread
Editing fields in bulkBrian Dunning5 Sep
  • RE: Editing fields in bulkHartleigh Burton5 Sep
  • Re: Editing fields in bulkGary Josack5 Sep
  • Re: Editing fields in bulkBaron Schwartz5 Sep
  • Re: Editing fields in bulkMartijn Tonies5 Sep