Quote Originally Posted by Sivak
Start time and end time is stored seperately in two different records and I would need to calculate time difference. Shipment_Id values identifies relation between records.

QUestion is,

I need to know SQL statement to generate this result. Can you give me a sample SQL.
Write the query without the lead/lag, is the row that you are looking for immediately preceding or following the row that you are comparing to? Is the offset always the same? According to the links you need to know the row offset.