分页的SQL语句

分页的SQL语句

sql="select * from (select row_number() over(orderby id) as num,* from table)as t where t.num>=@start and t.num<=@end";

分页的公式

int start=(pageIndex-1)*pageSize+1;

int end=pageIndex*pageSize;

posted @ 2014-12-01 20:39  甲壳虫博客  阅读(872)  评论(0编辑  收藏  举报