title: How can I sort A1,A2,A3,B1,B2,B3,...,AA1,AA2,AA3 in MySQL?
body: <p>I have a data set that looks like this:</p>
  
  <pre><code>+--------+
  | Square |
  +--------+
  | A1     |
  | A10    |
  | A2     |
  | A3     |
  | A4     |
  | A5     |
  | A6     |
  | A7     |
  | A8     |
  | A9     |
  | B1     |
  | B10    |
  | B2     |
  | B3     |
  | B4     |
  | B5     |
  | B6     |
  | B7     |
  | B8     |
  | B9     |
  </code></pre>
  
  <p>...</p>
  
  <pre><code>| AA1    |
  | AA10   |
  | AA2    |
  | AA3    |
  | AA4    |
  | AA5    |
  | AA6    |
  | AA7    |
  | AA8    |
  | AA9    |
  +--------+
  </code></pre>
  
  <p>The prefix runs from A#-Z#, then goes AA#-ZZ# and continues, with a maximum of 2 letters (i.e. it will never go over ZZ). The number suffix can be any length (i.e. A1,A10,A100,A1000,etc.).</p>
  
  <p>How can I sort these and have the result set come out as follows:</p>
  
  <pre><code>+--------+
  | Square |
  +--------+
  | A1     |
  | A2     |
  | A3     |
  | A4     |
  | A5     |
  | A6     |
  | A7     |
  | A8     |
  | A9     |
  | A10    |
  | B1     |
  | B2     |
  | B3     |
  | B4     |
  | B5     |
  | B6     |
  | B7     |
  | B8     |
  | B9     |
  | B10    |
  </code></pre>
  
  <p>...</p>
  
  <pre><code>| AA1    |
  | AA2    |
  | AA3    |
  | AA4    |
  | AA5    |
  | AA6    |
  | AA7    |
  | AA8    |
  | AA9    |
  | AA10   |
  +--------+
  </code></pre>