SET earth_radius = 6371.009;
SET axis = (SIN(RADIANS(lat2-lat1)/2) * SIN(RADIANS(lat2-lat1)/2) +
COS(RADIANS(lat1)) * COS(RADIANS(lat2)) *
SIN(RADIANS(long2-long1)/2) * SIN(RADIANS(long2-long1)/2));
SET distance = earth_radius * (2 * ATN2(SQRT(axis), SQRT(1-axis)));
RETURN ROUND(distance, 3);