create table tb(ID int,polls int,namevarchar(10))
insert into tbvalues(1 ,2 ,'张三')
insert into tbvalues(2 ,9 ,'李四')
insert into tbvalues(3 ,0 ,'王五')
insert into tbvalues(4 ,2 ,'赵六')
insert into tbvalues(5 ,2 ,'周七')
insert into tbvalues(6 ,8 ,'周润发')
insert into tbvalues(7 ,9 ,'张国荣')
go
select * , 排名= (selectcount(distinct polls)from tbwhere polls>= t.polls)from tb t orderby 排名
drop table tb