Select *,IsNull((Select count(distinct 正确数目) from 表 where 正确数目>a.正确数目),0)+1 as 名次 
from 表 a

解决方案 »

  1.   

    参考:
    http://expert.csdn.net/Expert/topic/2483/2483747.xml?temp=.2146417
      

  2.   

    select a.*,(select count(*) from 表 where 正确数目>=a.正确数目) as 名次 from 表 a
      

  3.   

    你要的是这一个
    select *,((select count(distinct 正确数目) from Table B where B.正确数目<A.正确数目)+1) AS 名次 
    from Table A这是另外的排名次的方法,与你的要求不同
    select *,((select count(1) from Table B where B.正确数目<A.正确数目)+1) AS 名次 from Table A