File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes Pagination Query in Oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Pagination Query in Oracle" Watch "Pagination Query in Oracle" New topic
Author

Pagination Query in Oracle

pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300

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

Joined: Oct 06, 2007
Posts: 338
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). ;)



 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Pagination Query in Oracle