I do have the following three tables within postgres
ShipmentTrip
id,shipment_id, type,status,lat,long
1, 1, pickup, whatever, 25, 75
2, 1, dropoff, whatever, 27, 76
3, 2, pickup, whatever, 25, 75
4, 2, dropoff, whatever, 27, 76
Shipment
id,...,driver_id
Driver
id
I am trying to calculate the full distance a driver made
I tried different ways but I am not able to solve it
Tried cross join and subqueries and many different approaches but still no result