Tuesday, July 8, 2008

String Replace in Mysql

UPDATE table_name   SET value= REPLACE(value,"dev","content");


here Value refers the column name;
ex:
if column value has "test_something" its replace "live_something" if we write the query like this below


UPDATE table_name   SET value= REPLACE(value,"test_","live_");

No comments:

Post a Comment