MariaDB 10.3.36
i need to calculate the timediff in sec between the date row and create a new column like diff_sec
2
SELECT id,date,section, TIMESTAMPDIFF(SECOND,date, lag(date, 1) OVER (ORDER BY date)) as diff_sec FROM garagedoor;
This works for me. Thx
Try this code:
(MySQL Code):
SELECT id,date,section, TIMESTAMPDIFF(SECOND,date, LAG(date, 1) OVER (ORDER BY date)) as diff_sec FROM difference;
If we run the code,
Click here to cancel reply.
2
Answers
This works for me. Thx
Try this code:
(MySQL Code):
If we run the code,