Paging with Oracle

前端 未结 6 2113
一向
一向 2020-11-22 13:01

I am not as familiar with Oracle as I would like to be. I have some 250k records, and I want to display them 100 per page. Currently I have one stored procedure which retr

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 13:34

    Just want to summarize the answers and comments. There are a number of ways doing a pagination.

    Prior to oracle 12c there were no OFFSET/FETCH functionality, so take a look at whitepaper as the @jasonk suggested. It's the most complete article I found about different methods with detailed explanation of advantages and disadvantages. It would take a significant amount of time to copy-paste them here, so I won't do it.

    There is also a good article from jooq creators explaining some common caveats with oracle and other databases pagination. jooq's blogpost

    Good news, since oracle 12c we have a new OFFSET/FETCH functionality. OracleMagazine 12c new features. Please refer to "Top-N Queries and Pagination"

    You may check your oracle version by issuing the following statement

    SELECT * FROM V$VERSION
    

提交回复
热议问题