Milky's note

[HackerRank](E) Weather Observation Station 14 본문

SQL/SQL 코딩 테스트-HackerRank

[HackerRank](E) Weather Observation Station 14

밀뿌 2022. 3. 25. 17:38

https://www.hackerrank.com/challenges/weather-observation-station-14/problem?isFullScreen=true 

 

Weather Observation Station 14 | HackerRank

Query the greatest value of the Northern Latitudes from STATION that are under 137.2345 and truncated to 4 decimal places.

www.hackerrank.com

 

[문제]

Query the greatest value of the Northern Latitudes (LAT_N) from STATION that is less than . Truncate your answer to  decimal places.

Input Format

The STATION table is described as follows:

where LAT_N is the northern latitude and LONG_W is the western longitude.

 

 

[답]

-mysql

select truncate(max(lat_N),4) from station
where lat_n < 137.2345

문제에서 137.2345 보다 큰 값들 중에 가장 큰 컬럼을 물어보았고, 4자리수 밑으로 버림을 하라고 하여서 truncate를 사용하였다.

Comments