Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pagination Query in Oracle

 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In MySQL we use limit query
Like select * from mytable limit 1 3.

But in oracle how we can perform this type of query for pagination.

I googled and find the below query

select * from (select a.*, rownum my_limiter from emp2 a ) where my_limiter between 1 and 3

Is this good way to use this query for pagination.

Please help me.

 
Paul Campbell
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pankaj semwal wrote:
In MySQL we use limit query
Like select * from mytable limit 1 3.

But in oracle how we can perform this type of query for pagination.

I googled and find the below query

select * from (select a.*, rownum my_limiter from emp2 a ) where my_limiter between 1 and 3

Is this good way to use this query for pagination.

Please help me.



Here is an example of another way using the all_objects view (sorry... I don't have your table in my schema). ;)



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic