title: Ranking based on two columns
body: <p>Finding the Rank of the Particular User from the Database by comparing three columns.</p>
  
  <pre>
  Name | Score | Attempts | Time
  test |   2   |   4      |  2019-01-29 19:50:11
  tes2 |   2   |   1      |  2019-01-29 20:14:11
  </pre>
  
  <p>So the Expected Output should be </p>
  
  <pre>
  Name | Score | Attempts | Time                  | Rank
  tes2 |   2   |   1      |  2019-01-29 20:14:11  |  1
  test |   2   |   4      |  2019-01-29 19:50:11  |  2
  </pre>
  
  <p>If I wanted to search Rank for User 'test' then I should get Rank 2 as my Answer.</p>
  
  <p>I have done the part from which I can get the overall Rank, but I couldn't able to find Rank for Individual User.</p>
  
  <p>This is code I have written for getting Overall Rank.</p>
  
  <pre><code>select t.*, @r := @r + 1 as `new_rank`
  from  tbl t,
  (select @r := 0) r
  order by `Rank` asc, `Tasks` desc`
  </code></pre>
  
  <p>SQL Version that I'm Using is 10.1.9-MariaDB</p>