By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
userID | tStamp | status | rst |
---|---|---|---|
Brown | 2017-10-18 03:20:28 | idle | 1 |
Brown | 2017-10-18 03:25:28 | idle | 0 |
Brown | 2017-10-18 04:00:28 | active | 1 |
Brown | 2017-10-18 04:10:28 | active | 0 |
Brown | 2017-10-18 04:35:28 | idle | 1 |
Brown | 2017-10-18 04:45:28 | idle | 0 |
Jason | 2017-10-18 03:20:00 | idle | 1 |
userID | status | tDiff |
---|---|---|
Brown | From idle to active | 40 |
Brown | From active to idle | 35 |
Brown | null | null |
Jason | null | null |