Hi all,
I'm a little stuck writing some SQL code to find the last value in a table and find the data stored between it and the previous value.
What I mean is every time a row is added into the table it is given a timestamp. I want to be able to find all data in the table between the latest timestamp and the previous. I have this so far but I'm useless at SQL any ideas would be really appreciated.
SELECT LAST(TIMEOCCURREDKEY) AS LASTTIMEOCCURREDKEY FROM PROCESSHISTORY
SELECT *
FROM PROCESSHISTORY
WHERE LASTTIMEOCCURREDKEY
SET TIMETEST = LASTTIMEOCCURREDKEY-1
BETWEEN TIMETEST and LASTTIMEOCCURREDKEY
This is what I have at the minute. I'm sorry if I didn't explain very well
Thanks
1 reply to this topic
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account



Back to top









