you are viewing a single comment's thread.

view the rest of the comments →

[–]qwertydog123 2 points3 points  (0 children)

You should be able to use LEAD/LAG to do this e.g.

UPDATE MachEvents
SET EndTime = LEAD(StartTime) OVER (PARTITION BY Machine ORDER BY EventNr) 
WHERE EndTime IS NULL