title: Ranking MySQL query results
body: <p>I have a table like this:</p>
  
  <pre><code>name | score
  asdf | 50
  zxcv | 100
  qwer | 80
  aaa  | 70
  .
  .
  .
  </code></pre>
  
  <p>and I could obtain someone's ranking via this query:</p>
  
  <pre><code>SELECT(
  SELECT COUNT(*)
  FROM leaderboard m2
  WHERE m2.score &gt;= m1.score
  ) as rank,name,score
  FROM leaderboard m1
  WHERE name='aaa'
  </code></pre>
  
  <p>and this query would give me something like this:</p>
  
  <pre><code>rank | name | score
    3  | aaa  |  70
  </code></pre>
  
  <p>The problem is the result I want to see with name='aaa' is like this : </p>
  
  <pre><code>rank | name | score
    2  | qwer |  80
    3  | aaa  |  70
    4  | asdf |  50
  </code></pre>
  
  <p>(with aaa's ranking and the around of aaa's result)</p>
  
  <p>How could it be done?</p>