- machine_id별 processing_time 출력하기
=> machine_id별 process_id별 start,end timestamp로 열이 나눠져 있으므로,
내부 JOIN을 통해 최종 출력값 도출 하기
SELECT a1.machine_id
,ROUND(AVG(a2.timestamp-a1.timestamp),3) AS processing_time
FROM Activity AS a1
JOIN Activity AS a2
ON a1.machine_id=a2.machine_id AND a1.process_id=a2.process_id
AND a1.activity_type='start' AND a2.activity_type ='end'
GROUP BY a1.machine_id