Paging with Oracle and sql server and generic paging method

前端 未结 7 1087
予麋鹿
予麋鹿 2020-12-17 00:29

I want to implement paging in a gridview or in an html table which I will fill using ajax. How should I write queries to support paging? For example if pagesize is 20 and wh

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-17 01:15

    If the expected data set is huge, I'd recommend to create a temp table, a view or a snapshot (materialized view) to store the query results + a row number retrieved either using ROWNUM or ROW_NUMBER analytic function. After that you can simply query this temp storage using row number ranges. Basically, you need to separate the actual data fetch from the paging.

提交回复
热议问题