title: MySQL query to reorder field values?
body: <p>I have table like this:</p>
  
  <pre><code>===============
  | rank | name |
  ===============
  |    3 | john |
  |    6 |  bob |
  |   10 | alex |
  |   11 | brad |
  |   12 | matt |
  |   34 | luke |
  |  145 |  ben |
  ===============
  </code></pre>
  
  <p>(this table is an example. In reality my table consists of ~5000 rows of data).</p>
  
  <p>Is there a query to reorder the rank values starting from 1 and going up so it ends up like this:</p>
  
  <pre><code>===============
  | rank | name |
  ===============
  |    1 | john |
  |    2 |  bob |
  |    3 | alex |
  |    4 | brad |
  |    5 | matt |
  |    6 | luke |
  |    7 |  ben |
  ===============
  </code></pre>
  
  <p>It would be preferable to do this in 1 or 2 queries, not 1 query for each row since my table has 5000+ rows.</p>
  
  <p><strong>EDIT</strong>: Sorry I wasn't clear. I am trying to UPDATE the values in the database.</p>