标签:mysql 地理位置排序
SELECT locationId,lon,lat,
(POWER(MOD(ABS(lon - x),360),2) + POWER(ABS(lat - y),2)) AS distance
FROM `eyanghu_location`
ORDER BY distance LIMIT 1000
x,y替换成你当前坐标的经纬度就行。
本文出自 “12571026” 博客,请务必保留此出处http://12581026.blog.51cto.com/12571026/1931654
标签:mysql 地理位置排序
原文地址:http://12581026.blog.51cto.com/12571026/1931654