SERVLET怎样实现数据分页?
2个回答
2013-08-30
展开全部
servlet分难做分页,除非在循环的sql语句中应用~~~
2013-08-30
展开全部
declare @pageIndex int --页索引
declare @pageSize int --页数据大小
set @pageIndex=1;
set @pageSize=20;
declare @From int
declare @To int
set @From=(@pageIndex - 1) * @pageSize + 1;
set @To=@pageIndex * @pageSize;
select * from
(
select a.*,ROW_NUMBER() OVER (ORDER BY /*排序字段*/ desc) AS RowNum from
(
--查询的数据
) as a
) as a
where RowNum BETWEEN @From AND @To ORDER BY RowNum ASC;
declare @pageSize int --页数据大小
set @pageIndex=1;
set @pageSize=20;
declare @From int
declare @To int
set @From=(@pageIndex - 1) * @pageSize + 1;
set @To=@pageIndex * @pageSize;
select * from
(
select a.*,ROW_NUMBER() OVER (ORDER BY /*排序字段*/ desc) AS RowNum from
(
--查询的数据
) as a
) as a
where RowNum BETWEEN @From AND @To ORDER BY RowNum ASC;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询