sql ranking

The top ten with the lowest salary, including those with the same ranking. Supreme empathy.
select @rank:=@rank+1 AS rank,p.* from
(
   select * from salaries where salary in
   (
      select salary from (select distinct salary from salaries
      order by salary asc limit 0,10) t  
    )
) p,(SELECT @rank: = 0) R & lt
Order by the salary ASC; Rank,

emp_no, the salary .
1 49239 38623
2 38623 253 406 .
3 281 546 38786 .
4 15830 38812 .
5 64198 38 836 .
6 475 254 38849 .
7 50419 38850 .
8 34707 38851 .
9 49239 38859
10 274 049 38864 .
11 38864 473.39 thousand
12 is 12444 38874

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326774589&siteId=291194637