Utterly Boring dot com

Search And Replace in MySQL

This is just mostly for my reference so I don't have to keep digging in the Google cache to get this site:

update tablename set field = replace(field,'search_for_this','replace_with_this');
I've probably used this bit of SQL a dozen times in the last week while doing some pruning/cleanup in a work database, I just kept forgetting the exact syntax.

Posted by Jake on 12/21/05 @ 03:01 PM
Posted in Geekdom | Permalink

What are you doing down here? Don't you have something better to do? Like Go Back To The Top of the page, or even see who created this site? This site is © 2001 - 2019 by the Utterly Boring folks at UtterlyBoring.com. Steal my content, as I probably did, too, just link to my site or the original site. Batteries not included. One size fits all. Not for off-road use. Not for internal use. Do not taunt Happy Fun Ball.