Find the time difference between two consecutive rows in the same table in sql

前端 未结 5 1425
广开言路
广开言路 2020-12-30 15:21

I\'m stuck. I\'ve looked for an answer, but can\'t seem to find subtracting time in the same table from two different rows of the same table that fits. I\'m having a difficu

5条回答
  •  無奈伤痛
    2020-12-30 15:33

    try something like that:

    select *, DATEDIFF(minute, (
        select max(b.TimeOut)
        from TIMESHEET as b where a.EmpID=b.EmpID and b.ROW

提交回复
热议问题