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替换成你当前坐标的经纬度就行。
时间: 2024-09-29 01:10:31
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替换成你当前坐标的经纬度就行。