Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 05d81d9

Browse files
Average Time of Process per Machine
1 parent 248d507 commit 05d81d9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Link: https://leetcode.com/problems/average-time-of-process-per-machine/
2+
Tool: MS SQL Server
3+
4+
5+
6+
7+
8+
9+
select a.machine_id, round(avg(a2.timestamp - a.timestamp),3) as processing_time
10+
from Activity a, Activity a2
11+
where a.process_id = a2.process_id and a.machine_id = a2.machine_id
12+
and a.activity_type = 'start' and a2.activity_type = 'end'
13+
group by a.machine_id

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /