The moose likes JDBC and Relational Databases and the fly likes recent entries from the database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "recent entries from the database" Watch "recent entries from the database" New topic

recent entries from the database

ramanuja varun
Ranch Hand

Joined: Aug 31, 2007
Posts: 47
Is there a way to retrieve the most recent entries from the database.If yes please do mention.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

You'll need to modify your data model to do this. You can add a modify date field to your table and select all those records after a chosen date.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45338
Or if you have an auto-increment column, "id", try select . . . where id = max(id) . . .
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: recent entries from the database
It's not a secret anymore!