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.
select a,b,c,d from inner table. The eucilidean distance formula from link- important thing is to note square root and cast function.
SELECT CAST(sqrt(((b-a)(b-a))+ ((d-c)(d-c)))AS DECIMAL(38,4))
FROM
(SELECT min(LAT_N) as a, max(LAT_N) as b, min(LONG_W) as c, max(LONG_W) as d
FROM Station) AS euclidean_distance;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 19
You are viewing a single comment's thread. Return to all comments →
select a,b,c,d from inner table. The eucilidean distance formula from link- important thing is to note square root and cast function.
SELECT CAST(sqrt(((b-a)(b-a))+ ((d-c)(d-c)))AS DECIMAL(38,4)) FROM (SELECT min(LAT_N) as a, max(LAT_N) as b, min(LONG_W) as c, max(LONG_W) as d FROM Station) AS euclidean_distance;