代码:
avg 字段平均值
avg+group by分组字段平均值
sql
# Write your MySQL query statement below
select
machine_id,
round(avg(if(activity_type='start',-timestamp,timestamp))*2,3)processing_time
from Activity
group by machine_id