title: Update with results of Ordered Select into Column
body: <p>I have a simple table with four columns: <code>id | name | score | rank</code> that looks like this:</p>
  
  <pre><code>id | name | score | rank
  ---|------|-------|-----
  1  | Bob  | 99    | -
  2  | Jim  | 88    | -
  3  | Rex  | 103   | -
  4  | Zus  | 55    | -
  </code></pre>
  
  <p>I'd like to sort these rows by <code>score</code> (descending) and store the approriate ranking in the <code>rank</code> column for each row.</p>
  
  <p>Currently, I'm using the following code to create an alias column that has the rankings:</p>
  
  <pre><code>SET @rank:=0;
  SELECT *, @rank:=@rank+1 AS rank_test FROM test ORDER BY score DESC
  </code></pre>
  
  <p>Which returns:</p>
  
  <pre><code>id | name | score | rank | rank_test
  ---|------|-------|------|----------
  3  | Rex  | 103   | -    | 1
  1  | Bob  | 99    | -    | 2
  2  | Jim  | 88    | -    | 3
  4  | Zus  | 55    | -    | 4
  </code></pre>
  
  <p>How can I transfer the result of the <code>rank_test</code> alias into the <code>rank</code> column?</p>
  
  <p>I've researched a lot of answers but can't seem to get anything to work. Fairly new to SQL so I apologize if it's a simple solution. Thank you!</p>