sqlserver的分页方式

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 当前页数*条数---     

执行结果是:

猜你喜欢

转载自blog.csdn.net/qq_26597927/article/details/80580320