SQL 高效分页查询
时间:2021-07-01 10:21:17
帮助过:4人阅读
@page int --页码
declare @pagecount int;
--每一页显示的记录数
set @page=2
set @pagecount=6
select * from (
select *,row_number()
over(
order by id
asc)
as row
from ADTypes)
as a
where row
between (
@page*@pagecount-@pagecount+1)
and (
@page*@pagecount)
SQL 高效分页查询
标签: