Hi everyone,
I am divided between using a C# implementation and a pure SQL 2005/2008 implementation. I need to determine the length of usage based on timestamps of their last actions. My table contains "friendID" (uniqueIdentifier) and "lastAction" datetime. Here is an example:
Bob, 1:00 PM Bob, 1:01 PM Bob, 1:20 PM Bob, 1:25 PM Jack, 5:00 PM Bob, 11:20 PM
I want to "time out" a user if they had 60 minutes of inactivity. If your suggestion works correctly, there should be 3 separate sessions from the data above. There is a long break between Bob's session that started at 1 PM and the one that started at 11:20 PM.
Correct results should be: Bob (duration 25 minutes), Jack (duration 0 minutes), Bob (duration 0 minutes)
How would you return those 3 rows using pure SQL or C#?
Thank you very much for your help, it is really needed here.