본문 바로가기

Language/SQL

[HackerRank][SQL] Weather Observation Station 2 - 컴도리돌이

728x90
 

Weather Observation Station 2 | HackerRank

Write a query to print the sum of LAT_N and the sum of LONG_W separated by space, rounded to 2 decimal places.

www.hackerrank.com


Problem

1. The sum of all values in LAT_N rounded to a scale of 2 decimal places.

->LAT_N의 모든 값의 합은 소수점 2자리 척도로 반올림하시오.
2. The sum of all values in LONG_W rounded to a scale of 2 decimal places.
->LONG_W의 모든 값의 합은 소수점 2자리 척도로 반올림하시오.


Answer

select round(sum(lat_n),2) as "lat", round(sum(long_w),2) as "lon"
from station

* round (반올림 함수)