I am still new in using sql server and would like some assistance. I have a table with 3 columns SerialNumber, EventDate and LaunchExitEventKey
I want to check if the LaunchExitEventKey from previous row is not equal to the next row i.e. 2 and 52 then calculate the duration by subtracting EventDate. In case if the LaunchExitEventKey is repeated eg 2,2,2,52 I need the last row for 2 and next 52 to calculate the duration.