select a.emp_no,a.salary,count(distinct b.salary) from salaries a inner join salaries b on a.salary<=b.salary group by a.emp_no order by a.salary desc