Skip to content

Commit 07ae498

Browse files
authored
Create 1661-average-time-of-process-per-machine.sql
1 parent 8642961 commit 07ae498

File tree

1 file changed

+6
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)