基於SQL的分頁

select top PageSize * from 表

where 條件 and id not in

(select top PageSize*(CurrentPageIndex-1)  id from 表 where 條件 order by 排序條件)

order by 排序條件

《PageSize 是GridView中每頁顯示的信息條數,PageSize*(CurrentPageIndex-1) 在SQL中不識別,需定義變量來替換》

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章