Weather Observation Station 13

Sort by

recency

|

1698 Discussions

|

  • + 0 comments

    select round(sum(LAT_N),4) from station where LAT_N < 137.2345 and LAT_N>38.7880;

  • + 0 comments

    SELECT CAST(ROUND(SUM(lat_n), 4, 1) AS DECIMAL(10,4)) FROM station WHERE lat_n > 38.7880 AND lat_n < 137.2345;

  • + 0 comments

    select cast(Round(sum(lat_n),4) as decimal(10,4)) from station where lat_n>38.7880 and lat_n <137.2345;

  • + 0 comments

    For MySQL Platform

    Using BETWEEN operator will give you the same result. But as per question, its wrong to use that operator because when using BETWEEN, both the start(38.7880) and end(137.2345) are included. If you read the question carefully, its greater than 38.7880(not >=) and less than 137.2345(not <=)

    In MySQL, There is a seperate function for truncating a decimal unlike standard ROUND function in other platforms. And that function is TRUNCATE

    SELECT TRUNCATE(SUM(lat_n), 4) FROM station
    WHERE lat_n > 38.7880 AND lat_n < 137.2345;
    
  • + 0 comments

    for ms sql server - SELECT CAST(FLOOR(SUM(LAT_N) * 10000) / 10000.0 AS DECIMAL(15,4)) FROM STATION WHERE LAT_N > 38.7880 AND LAT_N < 137.2345;