MYSQL:
SELECT s.emp_no,Y.salary,Y.t_rank FROM (SELECT X.salary,CAST((@number := @number+1) AS SIGNED) AS t_rank FROM (SELECT DISTINCT salary FROM salaries ORDER BY salary DESC) X JOIN (SELECT @number:=0) AS it) Y JOIN salaries s ON Y.salary=s.salary ORDER BY Y.salary DESC,s.emp_no ASC;