1
If you ensure that there are no "holes" in your field id
, 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 camp id
possess 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
Thank you very much friend! That was exactly it ..
– Tigger