Skip to content

Commit 5ec7a63

Browse files
committed
finish Average Time of Process per Machine
1 parent 67d404d commit 5ec7a63

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
select a1.machine_id, round(sum(a2.timestamp - a1.timestamp) / count(a1.machine_id), 3) as processing_time
2+
from Activity a1
3+
join Activity a2
4+
on a1.activity_type = "start" and a2.activity_type = "end" and a1.process_id = a2.process_id and a1.machine_id = a2.machine_id
5+
group by a1.machine_id;

0 commit comments

Comments
 (0)