select top 100 PERCENT row_number() over (order by jifen desc) as rank,schoolcard,name from IH_weekRank
从SQL中执行这个,获得一个排名的表(X行3列),我想知道这个表中某人的rank(就是在所有人中的排名),怎么获得?
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
你不会把这个排序外面再加个select的?
select * from (select top 100 PERCENT row_number() over (order by jifen desc) as rank,schoolcard,name from IH_weekRank ) t
where name = 'abcdef'
看红色部分,要加表名