I'm recording time for each operation when it starts and when it ends and how they are different operations me generates multiple rows , which I would like to have consolidated the start time and end if and only if the following operation is recorded within the next minute. If you spend more than one minute it is considered another consolidated row. Example
dbms is sql server 2008 R2
ID | PERSON | START | END | OP |TYPE
1 |2001668 |27/04/2016 22:58|27/04/2016 22:59|5901430|19
2 |2001668 |27/04/2016 23:00|27/04/2016 23:19|5901430|19
3 |2001326 |20/11/2009 04:16|20/11/2009 04:27|5901444|21
4 |2001668 |28/04/2016 11:19|28/04/2016 11:32|5901430|19
I would like the results to look like this:
PERSON | START | END | OP |TYPE
2001668 |27/04/2016 22:58|27/04/2016 11:19|5901430|19
2001326 |20/11/2009 04:16|20/11/2009 04:27|5901444|21
2001668 |28/04/2016 11:19|28/04/2016 11:32|5901430|19