Have some row set with next data
s1 in1 out1 t1 date1
s2 in2 out2 t2 date2
...
si ini outi ti datei
The table structure is:
s1 BIGINT PK
in
out
t BIGINT
date DATETIME
where date - date with time when session start, and time - how long will the session (in seconds). I need filtering in query with this condition:
row write to the result set if:
datei+1-datei<ti
It's because DB table have some amount corrupted rows. I can make this programmatically. But is it possible to make this in MySQL query? Most interesting are row offset.
UPDATE
When I say datei+1
- it's mean date from next row (offset by index)