We have a database that has a bunch of records with some bad data in one column, in which an embedded editor escaped some stuff that shouldn't have been escaped and it's breaking generated links.
I want to run a query to replace the bad characters in all the records, but can't figure out how to do it. I found the replace()
function in MySQL, but how can I use it inside a query?
For example, what would be the correct syntax if I wanted to replace the string <
with an actual less-than angle bracket (<
) in all records that have <
in the articleItem
column? Can it be done in a single query (i.e. select and replace all in one swoop), or do I have to do multiple queries? Even if it's multiple queries, how do I use replace()
to do the replace on the value of a field on more than one record?