码迷,mamicode.com
首页 > 数据库 > 详细

sql排序对比(row_number,rank,dense_rank)

时间:2016-03-18 17:44:08      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

不解释,全靠悟性:

select
loan_num,
row_number() over(order by loan_num asc) as ‘Row Number‘,
rank() over(order by loan_num asc) as ‘Rank‘,
dense_rank() over(order by loan_num asc) as ‘Dense Rank‘
from dbo.tals_loan

sql排序对比(row_number,rank,dense_rank)

标签:

原文地址:http://www.cnblogs.com/bluelight4587/p/5292894.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!