title: How to order query by number first and then by string in the same field
body: <p>I have a db in PostgreSQL 9.0, which has a table with a string field to store client codes.
  These codes are alphanumeric and can start with a letter or number, for example <code>1, 2, A0001-4, A0001-2, 10</code></p>
  
  <p>I want to order numeric first and then order by string, like</p>
  
  <pre><code>1, 2, 10, A0001-2, A0001-4
  </code></pre>
  
  <p>I do this with <code>to_number(fields, '99999999')</code>, for example:</p>
  
  <pre><code>SELECT * FROM empleados ORDER BY to_number(legajo, '99999999'), legajo
  </code></pre>
  
  <p>But when the code is like <code>'ve'</code>, with no number, the query fails.</p>
  
  <p>What can I do?</p>