Weather Observation Station 18 | HackerRank
Query the Manhattan Distance between two points, round or truncate to 4 decimal digits.
www.hackerrank.com

The Manhattan Distance 는 |x1 - x2| + |y1 - y2| = |a - c| + |b - d|.
<sql />
SELECT ROUND(ABS(MIN(LAT_N)-MAX(LAT_N)) + ABS(MIN(LONG_W)-MAX(LONG_W)),4)
FROM STATION

'Algorithm > SQL' 카테고리의 다른 글
[SQL][HackerRank] Weather Observation Station 20 (0) | 2020.06.10 |
---|---|
[SQL][HackerRank] Weather Observation Station 19 (0) | 2020.06.10 |
[SQL][HackerRank] Weather Observation Station 17 (0) | 2020.06.10 |
[SQL][HackerRank] New Companies (0) | 2020.06.10 |
[SQL][HackerRank] Binary Tree Nodes (0) | 2020.06.09 |