The Euclidean Distance 는 sqrt((a-b)2 + (c-d)2)
SELECT ROUND(SQRT(POW(MIN(LAT_N)-MAX(LAT_N), 2) + POW(MIN(LONG_W)-MAX(LONG_W), 2)), 4)
FROM STATION;
'Algorithm > SQL' 카테고리의 다른 글
[SQL][HackerRank] Contest Leaderboard (0) | 2020.06.11 |
---|---|
[SQL][HackerRank] Weather Observation Station 20 (0) | 2020.06.10 |
[SQL][HackerRank] Weather Observation Station 18 (0) | 2020.06.10 |
[SQL][HackerRank] Weather Observation Station 17 (0) | 2020.06.10 |
[SQL][HackerRank] New Companies (0) | 2020.06.10 |