title: MySQL select statement remove whitespace in WHERE clause
body: <p>I'm trying to match phone numbers based on the last 6 digits. The problem is the numbers in the database are in various formats, some have whitespace within the number.</p>
  
  <pre><code>SELECT * FROM users WHERE trim(phone) LIKE '%123456' 
  </code></pre>
  
  <p>Trim only removes the leading and trailing whitespace and doesn't find entries where clients have entered their numbers with whitespace between the numbers:
  123 456, 12 34 56, etc.</p>
  
  <p>So how to remove the whitespace within the search? Having the result without whitespace is not enough. Updating the database with replace is not an option either.</p>