title: Rank() over Partition by in mysql
body: <p>I'm completely stumped as to create a new column "LoginRank" from rank() over(partition by x, order by y desc) in mysql.</p>
  
  <p>From sql server i would write the following query, to create a column "Loginrank" that is grouped by "login" and ordered by "id".</p>
  
  <pre><code>select ds.id, 
         ds.login, 
         rank() over(partition by ds.login order by ds.id asc) as LoginRank
  from tablename.ds
  </code></pre>
  
  <p>I have the following table.</p>
  
  <pre><code>create table ds (id int(11), login int(11))
  insert into ds (id, login) 
  values  (1,1),
      (2,1),
      (3,1),
      (4,2),
      (5,2),
      (6,6),
      (7,6),
      (8,1)   
  </code></pre>
  
  <p>I tried applying many existing mysql fixes to my dataset but continue to have issues. </p>
  
  <p>Any help is greatly appreciated.
  Thanks!</p>