본문 바로가기

Language/SQL

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

728x90
 

Weather Observation Station 15 | HackerRank

Query the Western Longitude for the largest Northern Latitude under 137.2345, rounded to 4 decimal places.

www.hackerrank.com


Problem

Query the Western Longitude (LONG_W) for the largest Northern Latitude (LAT_N) in STATION that is less than 137.2345 . Round your answer to 4 decimal places.

-> lat_n이 137.2345보다 작은 값중에서 제일 큰 lat_n을 가진 long_w를 소수점 4자리에서 반올림하여 출력하시오.


Answer

select round(long_w,4)
from station
where lat_n < 137.2345
order by lat_n desc limit 1