Dense_Rank(), Row_Number(), Rank() in sql server

select id,number,name 
,DENSE_RANK() over(partition by number order by name ) as dense
,row_number() over(partition by number order by name ) as rownumber
,rank() over(partition by number order by name ) as ranks

from dbo.dense_demo

select * from dbo.dense_demo


get the below result:

posted on 2013-05-01 00:23  shcity  阅读(192)  评论(0编辑  收藏  举报

导航