How could I calculate differences of timestamps in a log-table?
Table log ( user_id integer, login boolean, ts timestamp )
So login = true would be a login-event and login = false a logout.
Is there a way to find the matching login/logout to calculate the
difference?
Or is there a better table "design" to do this?