 <p>You can update your query using your <code>SELECT</code> query. See below:</p> <pre><code>SET @rownum := 0; UPDATE Summoner_Champions SET Rank = (SELECT rank FROM (SELECT @rownum := @rownum +1 AS rank, total, UserID_ChampID FROM Summoner_Champions WHERE Champion_ID = 0 ORDER BY Total DESC) as result) </code></pre>