MySQL query add duration to previous record
问题 I like to add event duration to a previous record every time a new record gets added. This is what I have ID EventType EventTime EventDuration ------------------------------------- 1 TypeA 10:20 NULL 2 TypeB 09:30 NULL 3 TypeC 08:00 NULL This is what I want to achieve: ID EventType EventTime EventDuration ------------------------------------- 1 TypeA 10:20 00:50 2 TypeB 09:30 01:30 3 TypeC 08:00 ... 4 ... ... When a new records gets added (with ID, EventType and EventTime), the duration of