sql语句添加一列标示,然后进行分页。

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;

 

posted @ 2016-04-14 14:37  笨笨、你好  阅读(211)  评论(0编辑  收藏  举报