-1
Gentlemen, I have an appointment that makes the calculation by line.
The result is in the field calculo_diff
.
Calculation is the difference DataHoraTerno
,as shown below:
Now I need to make an average of calulo_diff
, as described.
That is, it would be an average of:
Operando H. Norma
Waiting for Carreta
Someone can help me?
SELECT Descricao
, DataHoraTerno
, @linha := TIME_FORMAT(TIMEDIFF(@DataHoraTerno, DataHoraTerno), '%H%i') AS calculo_diff
, @DataHoraTerno := DataHoraTerno AS valor_aux
, @voltas := @voltas + 1 AS voltas
FROM EmbarqueNavio
, (
SELECT @DataHoraTerno := 0
, @voltas := 0
) AS vars
WHERE NavioViagem = 3
AND Terno = 1
ORDER BY DataHoraTerno DESC
Hello @Arita, Welcome to Sopt, and recommend you post the code instead of his image, so click [Edit], do not forget to do the [Tour]
– Icaro Martins