How to correctly subtract these two columns in the SQL script?
SELECT DISTINCT b.prefixo as idVeiculo,
max(datatroca) as datatroca,
max(kmtroca) as kmtroca,
max(horimetroca) as horimetroca,
max(proximatroca) as proximatroca,
max(c.horimetro) as horimetroatual,
(a.proximatroca - c.horimetro) as Falta,
idMecanico FROM oleomotor a
JOIN veiculos b on (a.idVeiculo=b.idVeiculo)
JOIN hodometro c on (a.idVeiculo=c.idVeiculo)
GROUP BY a.idVeiculo order by datatroca DESC;