This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display only 2 rows from a recordset size of 10

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement like this:
I have a holiday definiton table and a holiday dates table.

For a given holiday definition, there can be multiple holiday dates. so, based on the seq no, i get to get all the holiday definitons and all the dates for each holiday definition.

From this recordset, i need to fetch the holiday dates, get the biggest of those dates and display only 1 row for each holiday definition on the view with the largest date. How do I manipulate the resultset?

Any help!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best way to to only fetch the records you want in the first pace. You may be able to do this with a simple where clause. If not, some database systems allow you to limit the returned data to a "slice" of the results. For example, PostgreSQL has the LIMIT and OFFSET keywords to do this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic