Two SQL paging query statement sharing


According to the meaning of the question:

The essence is to write paging query:

Number of entries per page: 10;

Current page: 4;

Copy codeThe code is as follows:
select * from
 (select ROW_NUMBER() over(order by Id asc) as num,* from UserInfo)as u
 where u.num
select top 10 * from UserInfo
where Id not in
(select top (10*3) id from UserInfo order by Id)
order by Id