存储过程的翻页原理

来源:百度知道 编辑:UC知道 时间:2024/05/30 20:54:49
谁能详细的告诉我存储过程的翻页原理?

编写一个带有输入参数的存储过程,参数为要显示的数据的页数,和要显示的数据的行数,根据这个参数来检索想要显示的内容。
比如:
create proc GetData
@pagenum int,
@linenum int
as
select * from tablename
where rownum > ((@pagenum-1) * @linenum)
and rownum <= (@pagenum * @linenum)

exec GetData @pagenum = 1,@linenum = 50

不知道这个答案是不是你要的?