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 19
Weather Observation Station 19
Sort by
recency
|
2145 Discussions
|
Please Login in order to post a comment
MS SQL Server
SELECT ROUND(SQRT(POWER((MIN(LAT_N) - MAX(LAT_N)), 2) + POWER((MIN(LONG_W) - MAX(LONG_W)), 2)), 4) FROM STATION;
I think the confusing problem about the values of (a,b) and (c,d) when saying the values corresponding to min, max of lat_n and min, max of long_w. Readers will easily understand it as a = min(lat_n), b = max(lat_n), c = min(long_w), d = max(long_w). While to get the correct result for this problem, we need a = min(lat_n), b = min(long_w), c = max(lat_n), d = max(long_w)
SELECT ROUND(SQRT( POWER(MAX(LAT_N)-MIN(LAT_N),2) + POWER(MAX(LONG_W)-MIN(LONG_W),2) ),4) FROM STATION;
Using MySQL:-
SELECT ROUND(SQRT(POW(MAX(LAT_N) - MIN(LAT_N), 2) + POW(MAX(LONG_W) - MIN(LONG_W), 2)), 4) FROM STATION;