摘要:
declare @t table(成绩 int,学生 varchar(10))insert @t select100,'小张' union select 70 ,'小力' union select 80 ,'小刚' union select 78 ,'小王'select *,Pid = (select count(1) from @t where 成绩 > a.成绩)+1from @t aorder by pid/*成绩 学生 Pid ----------- ---------- ----------- 100 ... 阅读全文