時(shí)間:2024-03-04 00:33作者:下載吧人氣:32
在Sql Server 2012之前,實(shí)現(xiàn)分頁(yè)主要是使用ROW_NUMBER(),在SQL Server2012,可以使用Offset …Rows Fetch Next … Rows only的方式去實(shí)現(xiàn)分頁(yè)數(shù)據(jù)查詢。
select [column1]
,[column2]
…
,[columnN]
from [tableName]
order by [columnM]
offset (pageIndex-1)*pageSize rows
fetch next pageSize rows only
網(wǎng)友評(píng)論