Example, I need the query to return these circled values. The previous result was 0 (zero). The current one does not. I need to get the current value. And list
If you make sure there are no "holes" in your id
field, then the solution below will show you the results you want:
SELECT *
FROM tabela t
WHERE t.Velocidade > 0
AND (SELECT t2.Velocidade
FROM tabela t2
WHERE t2.id = t.id - 1) = 0
Or, in the case of the field id
have some "jump":
SELECT *
FROM tabela t
WHERE t.Velocidade > 0
AND (SELECT t2.Velocidade
FROM tabela t2
WHERE t2.id < t.id
ORDER BY t2.id DESC
LIMIT 1) = 0