0
I have several fields with data
, hora
and sector
:
Sector|Horas|Data
------|------|-----
Corte |01:00 |12/03/2019 17:00
EXP |00:30 |12/03/2019 17:00
Etc
I want to subtract the time of the date, but always save the previous one as shown below:
Sector|Horas|Data |Resultado
------|------|-----
Corte |01:00 |12/03/2019 17:00|12/03/2019 16:00
EXP |00:30 |12/03/2019 17:00|12/03/2019 15:30
ETC
How can I fix this?
How did you get to the result shown in the second line? It shouldn’t be 16:30?
– anonimo
What the
SGBD
that you are using?– Sorack
I arrived at the result of the second line. Pk want to count from the end of the other result.
– user141887
In this case the use of windows functions can help you. See the documentation of your DBMS.
– anonimo