Current time: 09-05-2010, 09:47 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use find replace in MYSQL
04-29-2010, 09:37 PM
Post: #1
How to use find replace in MYSQL
If, like us you have lots of data in your mysql database and need to make a find/replace change (like in excel) you can!

So, for example, let’s say you have a table called “mytable” with data stored in a field called “mycontent” and you want to replace all instances of the word “one” with “two”, then your SQL would look like this:

Code:
update mytable set mycontent = replace(mycontent,'one','two');

Andrew
Hosted Web UK Staff
www.hostedweb.co.uk
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: