Simple solution without join
\nselect machine_id, \nround(sum(case when activity_type = \'start\' then -1*timestamp else timestamp end)/count(distinct process_id),3) as processing_time\nfro
```\nselect machine_id, \nround(sum(case when activity_type = \'start\' then -1*timestamp else timestamp end)/count(distinct process_id),3) as processing_time\nfrom Activity\ngroup by machine_id\n```\n
[]