select top 10 * from table1
where id>(select max(id)
from (select top 开始位置 id from table1 order by id)tt)

sql code:

select *
from (
select row_number()over(order by tempcolumn)temprownumber,*
from (select top 开始位置+10 tempcolumn=0,* from table1)t
where temprownumber>开始位置

包含allcount:

sql code:

SELECT* FROM (SELECT*, ROW_NUMBER() OVER(ORDER BY gdtUserId asc) RN,COUNT(*) OVER() AS allcount FROM t_gdt_user where gdtUserAddTime between '2023-02-16' and '2023-02-17' and gdtUserStatus = 0 and accountId = 61 and gdtUserAdInfo like '%%') T WHERE RN BETWEEN 0 AND 20 
       
粉丝