title: Alphanumeric sorting with PostgreSQL
body: <p>In the database, I have various alpha-numeric strings in the following format:</p>
  
  <pre><code>10_asdaasda
  100_inkskabsjd
  11_kancaascjas
  45_aksndsialcn
  22_dsdaskjca
  100_skdnascbka
  </code></pre>
  
  <p>I want them to essentially be sorted by the number in front of the string and then the string name itself, but of course, characters are compared one by one and so the result of Order by name produces:</p>
  
  <pre><code>10_asdaasda
  100_inkskabsjd
  100_skdnascbka
  11_kancaascjas
  22_dsdaskjca
  45_aksndsialcn
  </code></pre>
  
  <p>instead of the order I'd prefer:</p>
  
  <pre><code>10_asdaasda
  11_kancaascjas
  22_dsdaskjca
  45_aksndsialcn
  100_inkskabsjd
  100_skdnascbka
  </code></pre>
  
  <p>Honestly, I would be fine if the strings were just sorted by the number in front. I'm not too familiar with PostgreSQL, so I wasn't sure what the best way to do this would be. I'd appreciate any help!</p>