AVS
Intuition\n\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Tim
# Intuition\n\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```mysql []\nSELECT A1.machine_id, ROUND(AVG(A2.timestamp - A1.timestamp), 3) AS processing_time\nFROM Activity A1\nJOIN Activity A2 \nON A1.machine_id = A2.machine_id \nAND A1.process_id = A2.process_id \nAND A1.activity_type = \'start\' \nAND A2.activity_type = \'end\'\nGROUP BY A1.machine_id;\n\n```\n\n\n\n![avs-high-resolution-logo-black-transparent.png](https://assets.leetcode.com/users/images/c351ee64-c6be-4a96-bc5a-ac26dfd2cf38_1725149615.5858965.png)
['MySQL']