How to Find and Replace Text in MySQL

March 25th, 2009No Comments

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’);

Related Posts:

Tagged : ,

No Responses

Comments are closed.