📌  相关文章
📜  php 通过经纬度获取最近的位置 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:24.685000             🧑  作者: Mango

代码示例1
SELECT * , (3956 * 2 * ASIN(SQRT( POWER(SIN(( $lat - LatOnTable) *  pi()/180 / 2), 2) +COS( $lat * pi()/180) * COS(LatOnTable * pi()/180) * POWER(SIN(( $long - LongOnTable) * pi()/180 / 2), 2) ))) as distance  
from yourTable  
having  distance <= 10 
order by distance