数据库
首页 > 数据库> > MSSQL ROW_NUMBER和RANK和DENSE_RANK的区别

MSSQL ROW_NUMBER和RANK和DENSE_RANK的区别

作者:互联网

关键字说明:

脚本示例:

SELECT *,
row_number() over(ORDER BY Salary desc) as 'row_number',
dense_rank() over(order by Salary desc) as 'dense_rank',
rank() over(order by Salary desc) as 'rank'
FROM Employee

 

 

标签:Salary,DENSE,over,NUMBER,rank,number,RANK,dense,row
来源: https://blog.csdn.net/shionlin2010/article/details/121796373