title: Updating field based on sorting of another
body: <p>I have a user table which contains among others money, level and ranking.</p>
  
  <pre><code>Id | money| ranking| level
  ---------------------------
  1  |30000|    1         1
  2  |20000|    2         3
  3  |10000|    3         2
  4  |50000|    4         2
  </code></pre>
  
  <p>I want to update the ranking field based on user level (first filter) and money.</p>
  
  <p>That is a user in higher level will always be ranked higher.</p>
  
  <p>That is i want the table after the update like this:</p>
  
  <pre><code>Id | money| ranking| level
  ---------------------------
  1  |30000|    4         1
  2  |20000|    1         3
  3  |10000|    3         2
  4  |50000|    2         2
  </code></pre>
  
  <p>Thanks!</p>