I want to calculate the distance between multiple coordinates by time in sql. For example the car passes at point A at 1pm, and then at point B at 3 pm and in the end at point C at 6 pm. Points are connected among each other by the timestamp. So if the car has been in point A at 1 pm and then at point B at 3 pm and Point C at 6 pm. First the distance A to B is calculated and then B to C, and in the end we get the sum of these three points.I want to get the distance that the car passes per 1 day. The car can pass different number of points. For example it can go A->B->C->A or just A->B
I have tables for the CarId,CheckpointCordinates and datastamps.
Can you please guide me how to solve the problem. This question is asked once in here but no answer was given.
Thank you