分页。刚学的。Row_Number() Over
2011-04-25 16:10 沐海 阅读(269) 评论(0) 编辑 收藏 举报select * from (select distinct id, Row_Number() Over(order by Creattime desc) As rownum, Creattime from ActivityInfo) as d where rownum between 21 And 30 order by Creattime desc
string SQL1="select HelpId from (select distinct HelpId, Row_Number() Over(order by Creattime desc) As rownum, Creattime from HelpAnswer) as d where rownum between ("+pageIndex+"-1)*15+1 And "+pageIndex+"*15 order by Creattime desc";
本人声明:
个人主页:沐海(http://www.cnblogs.com/mahaisong)
以上文章都是经过本人设计实践和阅读其他文档得出。如果需要探讨或指教可以留言或加我QQ!欢迎交流!