Skip to content

Commit 7a5e1b2

Browse files
author
deepak14ri
committed
added average time of process
1 parent 91e529a commit 7a5e1b2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Write your MySQL query statement below
2+
SELECT a1.machine_id, ROUND(AVG(a2.timestamp-a1.timestamp), 3) AS processing_time
3+
FROM Activity a1 JOIN Activity a2
4+
ON a1.machine_id = a2.machine_id AND a2.process_id = a2.process_id
5+
AND a1.activity_type = 'start' AND a2.activity_type = 'end'
6+
GROUP BY machine_id;

0 commit comments

Comments
 (0)