Open falkirks opened 6 years ago
SELECT *, 3956 * 2 * ASIN(SQRT( POWER(SIN((49.260605 - abs(loc.latitude)) * pi()/180 / 2),2) + COS(49.260605 * pi()/180 ) * COS(abs(loc.latitude) * pi()/180) * POWER(SIN((-123.245994 - loc.longitude) * pi()/180 / 2), 2) )) as distance FROM locations loc ORDER BY distance;
Did you come up with that math on your own? 😛