Learn how to calculate durations between start and stop ticket records in MySQL. Complete guide with self-join queries, PHP implementation, and performance optimization tips.