sql server实现分页的方法实例分析

本文实例讲述了sql server实现分页方法分享给大家供大家参考,具体如下:

= ( select max(doccode) from ( select top (@num * (@index - 1) + 1) doccode from ppohd order by doccode ) as tb ) --分页3 select top (@num) * from ( select ppohd.doccode as 'mydoccode',row_number() over (order by doccode) as sno,* from ppohd ) as tb where tb.sno >= @num * (@index - 1) + 1 --分页4 select * from ( select ppohd.doccode as 'mydoccode',row_number() over(order by doccode) as sno,* from ppohd ) as tb where tb.sno between (@num * (@index - 1) + 1) and (@num * @index)

更多关于sql Server相关内容感兴趣的读者可查看本站专题:《》、《》、《》、《》、《》及《

希望本文所述对大家sql Server数据库程序设计有所帮助。

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...