0
I have a table with the following fields.
IMEI | TimeStamp | Value
123 | 1570011000| 1
123 | 1570012800| 0
123 | 1570015200| 1
123 | 1570017000| 0
I would like to take the last 2 records and make the difference between the Timestamp of the last 2 records.
I thought I’d make a select for each record:
select value, TimeStamp from myTable where TimeStamp = (select max(TimeStamp) from myTable) and value ='1'
select value, TimeStamp from myTable where TimeStamp = (select max(TimeStamp) from myTable) and value ='0'
But in the first select I have no return (just does not return anything and not error)
Already in the second select he returns me correctly.
How could I do that ?
Yeah, now it’s working fine, thanks for the help
– Gabriel Silva