title: Convert partially non-numeric text into number in MySQL query
body: <p>Is it possible to convert text into a number within MySQL query? I have a column with an identifier that consists a name and a number in the format of &quot;name-number&quot;. The column has VARCHAR type. I want to sort the rows according to the number (rows with the same name) but the column is sorted according to do character order, i.e.</p>
  <pre><code>name-1
  name-11
  name-12
  name-2
  </code></pre>
  <p>If I cut off the number, can I convert the 'varchar' number into the 'real' number and use it to sort the rows? I would like to obtain the following order.</p>
  <pre><code>name-1
  name-2
  name-11
  name-12
  </code></pre>
  <p>I cannot represent the number as a separate column.</p>
  <p><strong>edited 2011-05-11 9:32</strong></p>
  <p>I have found the following solution <code>... ORDER BY column * 1</code>. If the name will not contain any numbers is it safe to use that solution?</p>