代码
create proc sp_pagingwithproc
@page int
as
declare @count int
set @count = (select count(0from testtable)
select top 5 b.*
from (
    
select top (@count - 5*@page) indexcloumn
    
from testtable
    
order by indexcloumn desc) a,testtable b
where b.indexcloumn = a.indexcloumn
order by a.indexcloumn

@page 页码,0开始

@count 该表一共存在的纪录数

@testtable 表名

@indexcloumn 排序列

相关文章:

  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2021-12-19
猜你喜欢
  • 2022-01-31
  • 2021-10-18
  • 2022-02-20
  • 2022-12-23
  • 2021-10-18
  • 2021-10-21
相关资源
相似解决方案