알고리즘

[hackerrank, SQL] Weather Observation Station 14

Baro_forest 2022. 12. 30. 15:41

특정 위도보다 작은 수  중 가장 큰 값

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.

 

SELECT
ROUND(MAX(lat_n), 4)
FROM
station
WHERE
lat_n < 137.2345
;

예시에 주어진 137.2345의 자릿수 조건에 맞추기 위해

 

ROUND를 사용하여 동일한 조건으로 만들고 137.2345 보다 작은수중에 가장 큰 수를 (MAX)로 찾음