ROW_NUMBER() OVER()方式
select * from (
select *, ROW_NUMBER() OVER(Order by ArtistId ) AS RowId from ArtistModels
) as b
where RowId between 10 and 20
---where RowId BETWEEN (当前页数-1)*条数 and 当前页数*条数---
执行结果是:
ROW_NUMBER() OVER()方式
select * from (
select *, ROW_NUMBER() OVER(Order by ArtistId ) AS RowId from ArtistModels
) as b
where RowId between 10 and 20
---where RowId BETWEEN (当前页数-1)*条数 and 当前页数*条数---
执行结果是: