Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To Retrieve multiple rows separately

 
nami shekar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I retrieve only the first n rows, second n rows of a database (using a particular WHERE clause ? )
For example, if a SELECT typically returns a 1000 rows,
how do first retrieve the 100 rows, then go back and retrieve the next 100 rows and so on ?



Suggestions or comments are welcome
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using JPA, you can use the firstResult and maxResults properties on the Query.
 
nami shekar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks James,
You are right. I could use firstResult and maxResults to get it done.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic