title: Mysql - how to get the max value of a varchar column
body: <p>I have a table as follows ID is a numeric column and Total is Varchar(20) - table name is orders:</p>
  
  <pre><code>ID       Total
  
  1        $10
  
  2        $1,000
  
  3        $1500.50
  
  4        300
  
  5        20.50
  
  6        -80
  </code></pre>
  
  <p>through a </p>
  
  <pre><code>SELECT statement I would like to get the Id of the highest total i.e 3. 
  
  SELECT ID, MAX(CONVERT(Total, SIGNED INTEGER)) AS total FROM orders 
  </code></pre>
  
  <p>gives me the highest total but incorrect ID.</p>
  
  <p>I would like to ignore the dollar sign <code>($)</code> and comma <code>(,)</code>.</p>