MySQL - Perl: How to get array of zip codes within submitted “x” miles of submitted “zipcode” in Perl example
问题 I have found many calculations here and some php examples and most are just over my head. I found this example: SELECT b.zip_code, b.state, (3956 * (2 * ASIN(SQRT( POWER(SIN(((a.lat-b.lat)*0.017453293)/2),2) + COS(a.lat*0.017453293) * COS(b.lat*0.017453293) * POWER(SIN(((a.lng-b.lng)*0.017453293)/2),2))))) AS distance FROM zips a, zips b WHERE a.zip_code = '90210' ## I would use the users submitted value GROUP BY distance having distance <= 5; ## I would use the users submitted value But, I