Weather Observation Station 19

Sort by

recency

|

2271 Discussions

|

  • + 0 comments

    For MySQL

    SELECT
        ROUND(SQRT(POW(MAX(lat_n)-MIN(lat_n), 2) + POW(MAX(long_w)-MIN(long_w), 2)), 4)
    FROM station;
    
  • + 0 comments
    SELECT ROUND(SQRT(POWER((b-a),2) + POWER((d-c), 2)), 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);
    
  • + 0 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;

  • + 0 comments

    select round(sqrt(pow(max(lat_n)-min(lat_n),2)+pow(max(long_w)-min(long_w),2)),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) FROM STATION;