用sqlserver 的分页语句,能查出rownum给页面单独显示.是有序的.或者别...
发布网友
发布时间:2022-04-27 12:10
我来回答
共1个回答
热心网友
时间:2022-04-08 20:44
两种分布方式,个人习惯,你自己取舍吧:
定义:
当前页面是page,每页条目数是nums
1.top 方式
select top nums from * from talbe where id not in (select top (page-1)*nums from table order by id) order by id
2.row_number方式
select * from
(select *,ROW_NUMBER() over (order by id ) as 行号 from table) as t
where t.行号 between page*(num-1)+1 and page*num