Calculate average length of service

1

Well, I need to take the average number of calls and I have the following data:

00:12:35
00:05:10
00:01:42
00:08:12
00:01:01
{...}

The question is, how can I do it? I searched for a way to do this using Mysql's AVG but I did not succeed ... I tried to add and divide by the amount of records but the number was broken ... Has anyone ever had anything like this?

Thanks in advance for the help!

    
asked by anonymous 17.01.2018 / 19:37

1 answer

1

Make the average with integer values by converting the times to seconds and then converting to type time again:

SELECT SEC_TO_TIME(AVG(TIME_TO_SEC('tempo_atendimento')))
    
17.01.2018 / 20:51