天天看点

SQL Server 数据库分页语句

select top 20  *

from 

(

 select row_number() over(order by id ) as rownumber,* from test

) A 

where rownumber >min  AND rownumber <=max 

                                                                                    (推荐使用这种数据库分页,但是只支持Sql Server 2012以上版本)

                                                                                                    2018.5.24