什么MySQL查询将在表中的特定字段中执行文本搜索和替换?
例如,搜索foo并替换为bar,这样具有值为hello foo的字段的记录就会变成hello bar。
发布于 2008-09-24 03:23:47
发布于 2008-09-24 03:22:46
UPDATE table_name
SET field = replace(field, 'string-to-find', 'string-that-will-replace-it');发布于 2014-07-08 18:53:38
UPDATE table SET field = replace(field, text_needs_to_be_replaced, text_required);例如,如果我想用下面要使用的Mark替换所有出现的John,
UPDATE student SET student_name = replace(student_name, 'John', 'Mark');https://stackoverflow.com/questions/125230
复制相似问题