title: How can you tell MYSQL to TRIM the X number of characters, beginning from the Back?
body: <p>How do I write the following in MYSQL?</p>
  
  <p><CODE>SELECT SUBSTRING(value - (1 TRAILING CHARACTER)) FROM table;</CODE></p>
  
  <p>Basically substring(value, 2) trims the first letters. But I need to trim the last letters. I can't use substring(value, -4, 3) because I don't know the length of the value.</p>
  
  <p>Here's another example:
  <CODE>SELECT * FROM table WHERE SUBSTRING(value - (4 TRAILING CHARACTER)) in (SELECT SUBSTRING(value - (1 TRAILING CHARACTER)) FROM table);</CODE></p>