zip_code.sql CREATE FUNCTION `earth_distance_miles`(p1 point, p2 point) RETURNS int(11) RETURN ((ACOS(SIN(x(p1) * PI() / 180) * SIN(x(p2) * PI() / 180) + COS(x(p1) * PI() / 180) * COS(x(p2) * PI() / 180) * COS((y(p1) – y(p2)) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) SELECT earth_distance_miles( ( SELECT location FROM […]

continue reading.....