Skip to content
Advertisement

How to escape slashes in LIKE clause

I need to do some clean-up in a database and change some urls from http://www.domain1.com to http://www.domain2.com, so I am doing a query like this:

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

and therefore the replace query doesn’t work either, so what’s the correct way to escape these strings?

Advertisement

Answer

You might try:

To be honest, I don’t understand how or why forward slashes would be escaped. Perhaps you are better off just using a wildcard:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement