Weather Observation Station 18

Sort by

recency

|

2379 Discussions

|

  • + 0 comments

    Heres the working solution for MSSQL: SELECT CAST( ROUND( ABS(MAX(LAT_N) - MIN(LAT_N)) + ABS(MAX(LONG_W) - MIN(LONG_W)), 4) as decimal(10,4) ) AS MANHATTAN_DISTANCE FROM STATION;

  • + 0 comments

    SELECT ROUND(MAX(STATION.LAT_N) - MIN(STATION.LAT_N) + MAX(STATION.LONG_W) - MIN(STATION.LONG_W), 4) AS MANHATTAN_DISTANCE FROM STATION;

  • + 0 comments

    ` select round(max(LAT_N)-min(LAT_N)+max(LONG_W)-min(LONG_W),4) from station;

    `

  • + 0 comments

    select round(convert(decimal(10,4),abs(min(lat_n)-max(lat_n))+abs(min(long_w)-max(long_w))),4) from station;

  • + 0 comments

    Using MS SQL I Used Variable's and the ABS Function to give me absoulute differences between the values:

    DECLARE @A NUMERIC(20, 8) DECLARE @B NUMERIC(20, 8) DECLARE @C NUMERIC(20, 8) DECLARE @D NUMERIC(20, 8)

    SET @A = (SELECT MIN(Lat_N) FROM Station) SET @B = (SELECT MIN(Long_W) FROM Station) SET @C = (SELECT MAX(Lat_N) FROM Station) SET @D = (SELECT MAX(Long_W) FROM Station)

    SELECT CAST(ROUND((ABS(@A - @C) + ABS(@B - @D)), 4) AS Decimal(10,4)) AS Manhattan_Distance