题解 | 对所有员工的薪水按照salary降序进行1-N的排名
对所有员工的薪水按照salary降序进行1-N的排名
https://www.nowcoder.com/practice/b9068bfe5df74276bd015b9729eec4bf
select emp_no,salary, DENSE_RANK() OVER (order by salary DESC) as dr from salaries order by salary DESC, emp_no ASC;
对所有员工的薪水按照salary降序进行1-N的排名
https://www.nowcoder.com/practice/b9068bfe5df74276bd015b9729eec4bf
select emp_no,salary, DENSE_RANK() OVER (order by salary DESC) as dr from salaries order by salary DESC, emp_no ASC;
相关推荐