title: How can I use mySQL replace() to replace strings in multiple records?
body: <p>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.</p>
  
  <p>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 <a href="http://dev.mysql.com/doc/refman/4.1/en/string-functions.html#function_replace" rel="noreferrer">the <code>replace()</code> function</a> in MySQL, but how can I use it inside a query?</p>
  
  <p>For example, what would be the correct syntax if I wanted to replace the string <code>&amp;lt;</code> with an actual less-than angle bracket (<code>&lt;</code>) in all records that have <code>&amp;lt;</code> in the <code>articleItem</code> 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 <code>replace()</code> to do the replace on the value of a field on more than one record?</p>