I have a table with an skey column (generated by a sequence number) and a timestamp column.
I need to write a query that will find any records with a higher skey but an older timestamp than preceding records as it will indicate an issue.
ie something along the lines of:
select * from table
where timestamp < (select max(timestamp) from table where skey less than currrecord)
order by skey desc;
Use a
self joini.e. join the table to itself with the criteria that you have mentioned (SKey and TimeStamp)