【转】Sql server 2005 中的dense_rank()函数的应用
原文链接:http://blog.csdn.net/zlp321002/archive/2007/04/02/1549520.aspx
sql server 2005 排名提供dense_rank() 函数.实现起来非常简单.
示例如下:
declare @t table(place int,score int)
insert into @t select 11,10
union all select 3,10
union all select 2,20
union all select 2,30
select dense_rank()over(order by score ) as id,score from @t
/*
id score
-------------------- -----------
1 10
1 10
2 20
3 30
(4 行受影响)
*/
本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利
This posting is provided "AS IS" with no warranties, and confers no rights.
This posting is provided "AS IS" with no warranties, and confers no rights.

浙公网安备 33010602011771号