摘要:分页需要知道哪些数据?a 页大小:每页显示多少条数据PageSizeb 当前页:当前显示第几页数据CurrentPageIndexc 总页数: 按照页大小分配,表中的所有数据总共分几页显示。1 使用not in、子查询 ROW_NUMBER()a 使用not in、子查询select top PageSize * from 表 where 条件 and id not in(select top PageSize * (CurrentPageIndex -1) id from 表 where 条件 order by 排列顺序)order by 排列顺序b --使用ROW_NUMBER()即:加了
阅读全文