Weather Observation Station 19

Sort by

recency

|

2371 Discussions

|

  • + 0 comments

    in Ms Sql

    with dist as ( select min(lat_n) as a,min(long_w) as b,max(lat_n) as x, max(long_w) as y from station) select cast(sqrt(power((x-a),2) + power((y-b),2)) as decimal(10,4)) from dist

  • + 0 comments
    select round(sqrt((max(LAT_N)-min(LAT_N))*(max(LAT_N)-min(LAT_N))+(max(LONG_W)-min(LONG_W))*(max(LONG_W)-min(LONG_W))), 4)from STATION;
    
  • + 0 comments

    mssql:

    SELECT cast(round(sqrt(square(abs(max(lat_n)-min(lat_n))) + square(abs(max(long_w)-min(long_w)))),4) as decimal(10,4))

    FROM station;

  • + 1 comment
    /*
     d(p,q) = sqrt((p1 - q1) ^ 2 + (p2 - 2) ^ 2)
    */
    SELECT
        ROUND(SQRT(POWER((MIN(lat_n) - MAX(lat_n)), 2) + 
        POWER((MIN(long_w) - MAX(long_w)), 2)), 4)
    FROM station;
    
  • + 0 comments

    MYSQL Solution

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

    `