Oracle: How to calculate time according to row
Posted on 2011-03-03
I have a table that holds data regarding the users' activity on the phone. It looks like this
Agent date signofftime status
John 1/4/2011 11:17:33 BREAK
John 1/4/2011 11:35:56 Signed ON
John 1/4/2011 13:47:08 LUNCH
John 1/4/2011 14:22:43 Signed ON
Jane 1/4/2011 11:18:23 BREAK
Jane 1/4/2011 11:34:23 Signed ON
Jane 1/4/2011 12:00:05 LUNCH
Jane 1/4/2011 12:30:24 Signed ON
I want to calculate the time difference in hh:mm:ss between break and lunch status and the 'SignOn' time that immediately follows on the next row.
This table holds multiple users and multiple dates. It is certain tho that the Break and Lunch statuses are always followed by Signed on.
thank you in advance!