sql saves the day

Finally cracked the nut on a problem I've been working on: trying to determine from a login event and a record of logins and logouts whether that login event constitutes the beginning of a concurrent session for the given user. Trying to solve this problem using backtracking is a lot of effort and brushes up against the halting problem. In this method, we simply look backwards at logins and logouts from the event being inspected until we can determine if there is an overlapping session. The problem here is

...