title: MySQL Row counter in Update statement
body: <p>The following MySQL statement is working fine, and it returns me the rownumber as row, of each result. But now, what I want to do, is setting the column pos with the value of "row", by using an update statement, since I don't want to loop thousands of records with single queries.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>SELECT @row := @row + 1 AS row, u.ID,u.pos
  FROM user u, (SELECT @row := 0) r
  WHERE u.year&lt;=2010
  ORDER BY u.pos ASC LIMIT 0,10000
  </code></pre>