We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Weather Observation Station 18
Weather Observation Station 18
Sort by
recency
|
2403 Discussions
|
Please Login in order to post a comment
My SQL Solution :
-- ---> manhatten distance Formula = |x1-x2|+|y1-y2| -- as per question a = x1, b = y1, c = x2, d = y2 --abs() = return a non negative value
select round(abs(min(lat_n)-max(lat_n)) + abs(min(long_w)-max(long_w)), 4) from station `
In case you are using DB2 and still got the wrong answer, don't forget to use cast as decimal since this is caused by the trailing zeros.
Select Round(ABS(Min(LAT_N) - Max(LAT_N)) + ABS(Min(LONG_W) - Max(LONG_W)), 4) From STATION;
select round(((max(lat_n))-(min(lat_n)))+((max(long_w))-(min(long_w))),4) from station
SELECT ROUND(( MAX(LONG_W))-( MIN(LONG_W)),4) + ROUND(( MAX(LAT_N))-( MIN(LAT_N)),4) FROM STATION