JavaTechie

Its all about Technology

How to Find and Replace Text in MySQL March 25, 2009

Filed under: Mysql — javatechie @ 5:55 am

MySQL database has a simple string function REPLACE() that allows table data with the matching string (from) to be replaced by new string.

The syntax of REPLACE is REPLACE(text_string, from_string, to_string)

example:

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’);

 

Leave a Reply