I have a given SQLIt database (so no chance to do it in a better way):
CREATE TABLE `history` (
`TIMESTAMP` TIMESTAMP,
`DEVICE` `enter code here`varchar(32),
`TYPE` varchar(32),
`EVENT` varchar(512),
`READING` varchar(32),
`VALUE` varchar(32),
`UNIT` varchar(32)
);
In this table I have for example the following data:
DEVICE VALUE
d1 1
d5 500
d2 10
d1 2 <--
d5 501
d1 100 <---
I want to figure out for the device "d1" all timestamps where the difference between the last value and the current value is > 10
I have absolutly no idea how to do this with SQL
thank you