天天看點

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