title: Add period or punctuation to end of records in MYSQL?
body: <p>I've got a column in my database with descriptions. When the data was entered some of the descriptions are missing a period at the end and I would like to update the rows and add them if they don't exist.  </p>
  
  <p>Is the best approach to use the <code>REGEXP</code> function or is there a better way?</p>
  
  <p><strong>EDIT :</strong><br>
  This ended up being more complex than I had originally thought so I wanted to share this process for anyone else that may find it useful.</p>
  
  <ol>
  <li><p>The first complication was that I had records with whitespace and other characters at the end of some strings, which I took care of like this.</p>
  
  <pre><code>UPDATE table_name SET col_name = REPLACE(TRIM(TRAILING ' ' FROM col_name), 
                                           TRIM(TRAILING '\r' FROM col_name), 
                                           TRIM(TRAILING '\n' FROM col_name))
  </code></pre></li>
  <li><p>The second issue was excluding several other punctuation marks when adding the period. So here is the final query.  </p>
  
  <pre><code>UPDATE table_name
  SET col_name = CONCAT(col_name,'.')
  WHERE RIGHT(col_name,1) &lt;&gt; '.'
  AND RIGHT(col_name,1) &lt;&gt; '!'
  AND RIGHT(col_name,1) &lt;&gt; '?'
  </code></pre></li>
  </ol>