anup_daware
Member
I need to write a query/stored procedure where I want to get a specific number for records (say 10) from the database according to the time they are inserted into DB.
I store the insert time using SYSDATE and I want to retrieve the first ten inserted records (i.e. having smallest SYSDATE value) and then delete those from DB in one transaction.
If my table looks something like this:
RecordNum
RecordType
InsertTime
10
A
10/08/2007 14:20
20
B
10/08/2007 14:22
10/08/2007 14:27
I store the insert time using SYSDATE and I want to retrieve the first ten inserted records (i.e. having smallest SYSDATE value) and then delete those from DB in one transaction.
If my table looks something like this:
RecordNum
RecordType
InsertTime
10
A
10/08/2007 14:20
20
B
10/08/2007 14:22
10/08/2007 14:27