В MySQL <8.0, където regexp_replace()
и други подобни не се поддържат, можете да използвате функции за низове:
update wp_comments
set comment_content = concat(
substr(comment_content, 1, locate('XXX', comment_content) - 1),
'MMM',
substr(comment_content, locate('XXX', comment_content) + 3)
)
where comment_id = 334 and locate('XXX', comment_content) > 0
comment_id | comment_content ---------: | :----------------------------------------------------------------------------- 334 | Hello MMM tomorrow we XXX will meeting in XXX Dubai, Do you want join us XXX ?