Chris Tate-Davies

An archive of helpful tit bits of information for development, and probably some stuff that is incomplete, wrong or boring…

MySQL REPLACE

Posted on | March 18, 2010 | No Comments

I’d not come across REPLACE as a MySQL function before. I’d always used a combination of concatination of LEFTs and RIGHTs and the occasional MID.

Unbelievable that I’d not found this function before…

SELECT REPLACE(fieldname, "look for", "replace with") FROM tablename;

So simple…

 

Comments

Leave a Reply