UPDATE mytable set url = REPLACE(url, '"http://www.domain1.com"', '"http://www.domain2.com"')
the double comma is needed as this strings are part of a JSON string
however, the problem is that in the DB the old url is for some reason escaped so I have something like this
if I run a query like these they don’t match anything
select * from mytable where url like '%http://www.domain1.com%' select * from mytable where url like '%http://www.domain1.com%'
and therefore the replace query doesn’t work either, so what’s the correct way to escape these strings?
You might try:
where url like '%http:\/\/www.domain1.com%'
To be honest, I don’t understand how or why forward slashes would be escaped. Perhaps you are better off just using a wildcard:
where url like '%http:_/_/www.domain1.com%'