mysql地图两地之间的经度纬度按3公里以内查询

SELECT asin(sqrt(POW((cos(origin_latitude*0.01745329251994329)*cos(origin_longitude*0.01745329251994329))-(cos(22.818906*0.01745329251994329)*cos(108.369461*0.01745329251994329)),2)+

POW((sin(origin_latitude*0.01745329251994329)*cos(origin_longitude*0.01745329251994329))-(sin(22.818906*0.01745329251994329)*cos(108.369461*0.01745329251994329)),2)+

POW(sin(origin_longitude*0.01745329251994329)-sin(108.369461*0.01745329251994329),2)/2))* 1.27420015798544E7/1000,origin_latitude,origin_longitude

FROM order_basic

WHERE  asin(sqrt(POW((cos(origin_latitude*0.01745329251994329)*cos(origin_longitude*0.01745329251994329))-(cos(22.818906*0.01745329251994329)*cos(108.369461*0.01745329251994329)),2)+

POW((sin(origin_latitude*0.01745329251994329)*cos(origin_longitude*0.01745329251994329))-(sin(22.818906*0.01745329251994329)*cos(108.369461*0.01745329251994329)),2)+

POW(sin(origin_longitude*0.01745329251994329)-sin(108.369461*0.01745329251994329),2)/2)

)* 1.27420015798544E7/1000<3

ORDER BY id DESC

LIMIT 0 , 30

你可能感兴趣的:(mysql地图两地之间的经度纬度按3公里以内查询)