MySQL WordPress Query Returning a Distance of Zero for Some Records
问题 I wrote a query against a WordPress Database that selects the 10 closest restaurants, ordered by distance. For some reason, the first three have a distance of zero and I can't for the life of me figure out why. Any ideas? Here is the SQL: SELECT pm1.post_id, (6371 * acos( cos( radians(51.507351) ) * cos( radians( pm1.meta_value) ) * cos( radians(pm2.meta_value) - radians(-0.127758)) + sin(radians(51.507351)) * sin( radians(pm1.meta_value))) ) AS distance, pm1.meta_value AS lat, pm2.meta_value