Weather Observation Station 19

Sort by

recency

|

2192 Discussions

|

  • + 0 comments
    -- MySQL
    select round(
    pow(
    pow(max(lat_n) - min(lat_n), 2) +
    pow(max(long_w) - min(long_w), 2)
        , 0.5)
        , 4) as distance
    from station;
    
  • + 0 comments

    Best Solution 😁😎

    select cast( sqrt( power((max(lat_n) - min(lat_n)),2) + power((max(long_w) - min(long_w)),2) ) as decimal(10,4)) from station;

  • + 0 comments

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

  • + 0 comments

    SELECT ROUND(SQRT(POWER(MAX(lat_n) - MIN(lat_n), 2) + POWER((MAX(long_w) - MIN(long_w)), 2)), 4) FROM station;

  • + 0 comments
    SET @a = (SELECT MIN(lat_n) FROM station);
    SET @b = (SELECT MAX(lat_n) FROM station);
    SET @c = (SELECT MIN(long_w) FROM station);
    SET @d = (SELECT MAX(long_w) FROM station);
    
    SELECT ROUND(SQRT(POWER((@b - @a), 2) + POWER((@d - @c), 2)), 4)