I have a table like the following but approximately 7 million rows. What I am trying to find out is how many cases is each user working on simultaneously? I would like to groupby the username and then get an average count of how many references are open concurrently between the two times.
Reference | starttime | stoptime | Username |
---|---|---|---|
1 | 2020-07-28 06:41:56.000 | 2020-07-28 07:11:25.000 | Arthur |
2 | 2020-07-18 13:24:02.000 | 2020-07-18 13:38:42.000 | Arthur |
3 | 2020-07-03 09:27:03.000 | 2020-07-03 10:35:24.000 | Arthur |
4 | 2020-07-05 19:42:38.000 | 2020-07-05 20:07:52.000 | Bob |
5 | 2020-07-04 10:22:48.000 | 2020-07-04 10:24:32.000 | Bob |
Any ideas?