We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Weather Observation Station 13
Weather Observation Station 13
Sort by
recency
|
1698 Discussions
|
Please Login in order to post a comment
select round(sum(LAT_N),4) from station where LAT_N < 137.2345 and LAT_N>38.7880;
SELECT CAST(ROUND(SUM(lat_n), 4, 1) AS DECIMAL(10,4)) FROM station WHERE lat_n > 38.7880 AND lat_n < 137.2345;
select cast(Round(sum(lat_n),4) as decimal(10,4)) from station where lat_n>38.7880 and lat_n <137.2345;
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
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;