I am facing issue while updating the substring of paths stored in table . I need to change sub string C:\Program Files (x86) as %APPDATA% for column path.
Below is SQL and this SQL is not updating the path, showing 0 updated rows. What am i doing wrong here?
/*Path: C:\Program Files (x86)\Fiddler2\Fiddler.exe*/
UPDATE software
SET path = REPLACE(path, 'C:\Program Files (x86)', '%APPDATA%')
WHERE path LIKE '%C:\Program Files (x86)%';
'\', the string in the comment shows a forward slash character'/'. Those are two different characters. The backslash character is a special character in the context of a MySQL string literal. To get a literal backslash character in a string literal, we need to two escape the backslash with another backslash character... two backslashes, e.g.SELECT '\\'.