[求助]求分页的存储过程和调用方法或者中间页的算法!
泡泡鱼_ 2004-12-31 02:36:57 [求助]求分页的存储过程和调用方法或者中间页的算法!
求基于MS Sql2000的分页的存储过程和调用方法或者中间页的算法!
如分页的首页可以用select top 10 from tbname order by id asc
尾页用select top (总记录-每页显示记录数*(总页数-1)) from tbname order by id desc
请问,中间那些页的算法是怎么样?比如总记录数为2963,每页显示10条,则总页数为297
这时怎么得出第四页的记录
中间页我打算用select from tbname where id between 首ID and 尾ID order by id asc 来做SQL语句的
哪位兄弟做过吗??可以告诉我怎么解决的吗??