Weather Observation Station 19

Sort by

recency

|

2241 Discussions

|

  • + 0 comments

    SELECT ROUND( SQRT(POW(MAX(LAT_N) - MIN(LAT_N), 2) + POW(MAX(LONG_W) - MIN(LONG_W), 2)), 4 ) AS Euclidean_Distance FROM STATION;

    Explanation: MIN(LAT_N): This gets the minimum value of Northern Latitude. MAX(LAT_N): This gets the maximum value of Northern Latitude. MIN(LONG_W): This gets the minimum value of Western Longitude. MAX(LONG_W): This gets the maximum value of Western Longitude. The POW function is used to square the differences between the respective coordinates. The SQRT function calculates the square root of the sum of the squared differences to get the Euclidean distance. ROUND(..., 4): This rounds the final distance to 4 decimal places.

  • + 0 comments

    MSSQL:

    SELECT FORMAT(ROUND(SQRT(SQUARE(MAX(LAT_N)-MIN(LAT_N)) + SQUARE(MAX(LONG_W)-MIN(LONG_W))), 4), '0.0000') FROM STATION;

  • + 1 comment

    with TN as(Select Min(LAT_N) as a,Max(LAT_N) as b,Min(Long_W) as c,Max(Long_W) as d from Station) select round(sqrt(power((a-b),2)+power((c-d),2)),4) from TN

  • + 0 comments

    for MSSQL: select cast( round( power( power(abs(max(LAT_N)-min(LAT_N)),2)+ power(abs(max(LONG_W)-min(LONG_W)),2)/* Square of (b-a) +Square of (d-c)*/ ,0.5) /Square root of above expression/ ,4) as decimal(10,4) ) AS Euclidean_Distance from station

  • + 0 comments

    SELECT ROUND(SQRT(POWER((MIN(LAT_N)- MAX(LAT_N)), 2) + POWER(( MIN(LONG_W) - MAX(LONG_W) ),2)),4) FROM STATION