Easiest solution by calling column twice
\n\n# Code\nmysql []\n# Write your MySQL query statement below\nSelect a.machine_id,ROUND(AVG(b.timestamp-a.timestamp), 3)as processing_time from Activity a, Ac
\n\n# Code\n```mysql []\n# Write your MySQL query statement below\nSelect a.machine_id,ROUND(AVG(b.timestamp-a.timestamp), 3)as processing_time from Activity a, Activity b\nwhere a.process_id=b.process_id AND a.machine_id=b.machine_id\nAND a.activity_type="start" AND b.activity_type="end"\ngroup by machine_id;\n```\n![upvote image leet.jpeg](https://assets.leetcode.com/users/images/00938873-8314-45dd-a8df-748ddde52267_1725377932.2227716.jpeg)\n
['MySQL']