control in columns very easy
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-
# Intuition\n# ****![6f09a07f-6131-43f8-9776-988fb8b2a0e0_1690231008.6064973.png](https://assets.leetcode.com/users/images/08f5ea8d-88f5-4f7d-92e5-9bbed71ee16f_1698044969.7393358.png)****\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```\n# Write your MySQL query statement below\nselect  a1.machine_id, round(avg(a1.timestamp - a2.timestamp),3) as processing_time\nfrom Activity a1, Activity a2\nwhere a1.machine_id = a2.machine_id\nand   a1.process_id = a2.process_id\nand   a1.activity_type = \'end\'\nand   a2.activity_type = \'start\'\ngroup by a1.machine_id\n```
['MySQL']