W MySQL <8.0, gdzie regexp_replace()
i tym podobne nie są obsługiwane, możesz użyć funkcji ciągów:
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 ?