1 select id= IDENTITY(INT,1,1) , sum(Score) as Score ,Student_NO,Student_Name 2 3 into #a2_tab 4 from ksy_stu_ScoreInfo GROUP BY Student_NO,Student_Name order by Score desc 5 6 SELECT TOP (@Pagecount) * FROM #a2_tab WHERE id > (@byPage*@Pagecount); 7 DROP TABLE #a2_tab;