Easy 🥳, simple ❗️❗️❗️ querry using only {case when ... then ...}
1.Lastly to round 3 digits after column\n\uD83D\uDC47\uD83C\uDFFB \n\nRound( ,3)\n\n2.To get average of all cells with timestamp column\n\uD83D\uDC47\uD83C\uDFF
**1.Lastly to round 3 digits after column**\n\uD83D\uDC47\uD83C\uDFFB \n```\nRound( ,3)\n```\n**2.To get average of all cells with timestamp column**\n\uD83D\uDC47\uD83C\uDFFB \n```\nRound(avg(),3)\n```\n**3.Simple institution \uD83E\uDD17 \nwhen activity is start, get from row timestamp\nwhen activity is end, get from row -timestamp**\n\uD83D\uDC47\uD83C\uDFFB\n```\nRound(avg(case\nwhen activity_type="start" then timestamp\nwhen activity_type="end" then -timestamp\nend),3)\n```\n**4.In 3rd step our avg() getting 2 times more values,\nso deviding it into the same number. \nJust multiply it by 2**\n\n**5.As out end allways greater you can use "-" sign like this \uD83D\uDC47\uD83C\uDFFB**\n```\nRound(avg(\n  case\nwhen activity_type="start" then timestamp\nwhen activity_type="end" then -timestamp\nend\n)*(-2),3)\n```\n**or avg() function it is your wish**\n\n**GOOD LUCK\u2757\uFE0F**\n# Code\n```\n# Write your MySQL query statement below\nselect machine_id, Round(avg(\n  case\nwhen activity_type="start" then timestamp\nwhen activity_type="end" then -timestamp\nend\n)*(-2),3)as processing_time\nfrom activity\ngroup by machine_id\n```
['MySQL']