Not sure I understand it completely, but what about taking min(starttime) and max(endtime) grouping by subject_id?
select min(starttime),max(endtime),subject_id from dataset group by subject_id;
Maybe some example data might help, can you come up with a simple case and a slightly more complex case?
@Greenbank started
London Fixed Gear and Single-Speed is a community of predominantly fixed gear and single-speed cyclists in and around London, UK.
This site is supported almost exclusively by donations. Please consider donating a small amount regularly.
Not sure I understand it completely, but what about taking min(starttime) and max(endtime) grouping by subject_id?
Maybe some example data might help, can you come up with a simple case and a slightly more complex case?