Hi, Is there a way to pull the recent 20 records from Oracle Database table without using any field in particular. My table contains fields like , session_id - looks like random number generator timestamp with only date not the time. The table is logged by some application in the background whenever a transaction is occurred. For example , in any web server if u view the log file thru the administrative screen/console u have this option like display the recent 20 records or display the last first. That kind of thing. but i don't know how to write SQL query to display the recently inserted 20 records at any point of time.
Well I don't think there is a direct method to retreive the last 20 records. You will either have to add a timestamp field in your table or if thats not possible add another table in your database which will keep track of the records inserted in the reqd. table.
Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Joined: Jun 27, 2001
Hi Parmeet, Thanks for ur reply. I was talking to one of our developer who is logging that table which has date field. He told me to write a query to display both the date and time from "date" field. It appears like this "MM-DD-YYYY:HH:MM:SS" will u pls. tell me how to sort this particular column to get the recent 20 records at any point of time. Thanks, mahendran