I know there are many stackoverflow pages asking about calculating date-time differences between rows but I have not found one that answers my particular question. Most are interested in data between subsequent rows but I need to calculate for a series of individuals how much time has elapsed for each individual. For example
id time (of the day)
1 12:00:40
1 12:06:35
1 12:12:00
2 14:59:22
2 15:10:40
I would like to calculate something that looks like this:
id total time (seconds)
1 760
2 678
Thanks in advance for help and I apologize if this has been answered somewhere else, I have not been able to find it.