I would like to know how I could get the hours between date_ini and end_date
EQUIPO TIPO_MANTE FECHA_INI FECHA_FIN Horas TOTAL
LAPTOP A 12/20/18 12/21/18 24 50
DESKTOP A 12/20/18 12/21/18 24 400
LAPTOP A 12/20/18 12/23/18 72 100
LAPTOP B 12/21/18 12/22/18 24 200
LAPTOP A 12/22/18 12/24/18 24 50
that in this case it would be my query to get the hours
SELECT S.Equipo, S.Tipo_mante, HOUR( TIMEDIFF( T.Fecha_fin, T.Fecha_ini ) )
AS 'difirencia'
FROM orden_trabajo t
LEFT JOIN solicitud_mante s ON S.Id_soli = T.Id_soli
WHERE S.Tipo_mante = 'Inmediato'
GROUP BY S.Equipo, S.Tipo_mante
HAVING COUNT( * ) >1
But it would be that if the same TEAM AND THE SAME MAINTENANCE are repeated that I add the hours I have tried to do the sum but it gives me error