728x90
SELECT 가져올컬럼,
(6371*acos(cos(radians(lat좌표값))*cos(radians(slLat))*cos(radians(slLng)
-radians(lng좌표값))+sin(radians(lat좌표값))*sin(radians(slLat))))
AS distance
FROM 대상테이블
HAVING distance <= 거리
ORDER BY distance
LIMIT 0,1000
📖 참고
728x90
'🎯 etc > Query' 카테고리의 다른 글
[ QueryDSL ] Spring Boot + Querydsl (1) (0) | 2022.11.24 |
---|
댓글