0
I have two tables, I want to get the previous record of recorded data from the second table based on the first.
Tabela 1 | Tabela 2
id - hora | id - id_tabela1 - cod
1 02:30 | 1 1 1
2 02:45 | 2 2 3
3 03:00 | 3 3 1
What I wanted was to get the time difference between the codes. ex.
diferenca
cod - hora
1 00:00
3 00:00
1 00:30
Does anyone know what this query would look like in Mysql?
I could not understand your doubt. Be clearer
– Amanda Lima