title: getting rank of a row in a rowset
body: <p>I have the following rows :</p>
  
  <pre><code>id        name        score
  
  1         Bill        0
  2         Kim         8
  3         Michael     30
  4         Doug        22
  5         Mellisa     1
  </code></pre>
  
  <p>When I do <code>SELECT * FROM table ORDER BY score DESC</code>, I get</p>
  
  <pre><code>id        name        score
  
  4         Doug        22
  3         Michael     30
  2         Kim         8
  5         Mellisa     1
  1         Bill        0
  </code></pre>
  
  <p>Now I want  to get only one row, so I'll add a where clause, but problem is the ranking. </p>
  
  <p>I'm producing <em>pseudo ranks</em> in my php code, i.e. the first row in the rowset is assigned rank 1, second is assigned rank 2 and so on...</p>
  
  <p>So when I do <code>SELECT * FROM table WHERE id = 5</code>, apparently all the rank information is lost. How to get over this problem? Is there any way I could get the position of the row in rowset before adding the where clause?</p>