我想取得排序的位置,比如:要作一个根据分数排名的。想知道每个人的都排在第几名。怎么取得所在的名次啊。大家给个例子啊。谢谢了
解决方案 »
- https协议!!
- 自定义分页怎么这样?
- 求个简单的 正则表达式
- 高手进---图片验证 的 正则表达式
- VS2005,C#,flash,问些flash的一些基本问题,如flash的自动关闭
- asp.net 跨域读取cookie 问题(分不够在加)
- DATAGRID的奇怪问题!急!(在线等)
- 取textbox的当前光标位置?可行否?
- 为大家创造一个互相学习的机会~~喜欢的踊跃报名呀~~:)
- silverlight中,datagrid无法选中多行?
- DataBinder.Eval(Container.DataItem,"newtitle")如何取前10个字符(C#)?
- 怎样在每个web页面设置默认按钮?
go
insert into #temp(cj) values(80)
insert into #temp(cj) values(70)
insert into #temp(cj) values(70)
insert into #temp(cj) values(90)
insert into #temp(cj) values(60)
insert into #temp(cj) values(50)
go
update #temp set pm=b.pm from #temp a,(select distinct cj,(select count(*)+1 from #temp where cj>a.cj ) as pm from #temp a ) b where a.cj=b.cj
select * from #temp order by pm
drop table #temp
cj pm
------------ -----------
90.00 1
80.00 2
70.00 3
70.00 3
60.00 5
50.00 6
(所影响的行数为 6 行)