Question

Due to a coding error by a prior dev I've discovered we have a mysql table that has a bit of data that has an extra escape character.

update mytable SET title = TRIM(TRAILING '\' FROM title)

I've tried the above but it obviously throws an error, and I've tried '\\'. How do I get mysql to treat the backslash literally on it's own?

Was it helpful?

Solution

Try the following:

update mytable SET title = TRIM(TRAILING '\\' FROM title)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top