Sum hours obtained through a query in mysql

Asked

Viewed 285 times

0

SELECT
    TIMEDIFF(
        atendimento_ticket.close_atendimento,
        atendimento_ticket.open_atendimento
    ) AS duracao
FROM
    atendimento_ticket
WHERE
    id_tec = '$id_tec'
  • Being able to do the following sq is not well formatted. SELECT SUM(duration) FROM (SELECT TIMEDIFF( attendance_ticket.close_attendance, attendance_ticket.open_attendance ) AS duration FROM attendance_ticket WHERE id_tec = 5 ) as dur

  • SELECT
 SUM(TIMEDIFF(
 atendimento_ticket.close_atendimento,
 atendimento_ticket.open_atendimento
 )) AS total_duracao
FROM
 atendimento_ticket
WHERE
 id_tec = '$id_tec'

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.