मुझे यकीन नहीं है कि एक सबक्वेरी जरूरी है...
SELECT AVG(TIME_TO_SEC(y.creation_time)-TIME_TO_SEC(x.creation_time)) avg_diff
FROM my_table x
JOIN my_table y
ON y.operation_id = x.operation_id
AND y.operation_type = 'end'
WHERE x.operation_type = 'start';