title: mysql ranking based on sum of values
body: <p>having a mysql table with multiple records belonging many different users like this:</p>
  
  <h2>id                   score</h2>
  
  <p>1  ,    50</p>
  
  <p>1  ,    75</p>
  
  <p>1   ,   40</p>
  
  <p>1,  20 </p>
  
  <p>2    ,  85</p>
  
  <p>2     , 60</p>
  
  <p>2     , 20 </p>
  
  <p>i need to get the rank of each id but after finding the sum of their score;</p>
  
  <p>the rank should be the same if the total score for each player is the same.</p>
  
  <p>this gives me the total for each player:</p>
  
  <pre><code>select id,sum(score) as total from table_scores group by id order by total desc;
  </code></pre>
  
  <p>is it posssible to find the sum like above and use it to rank the players in one query?</p>