Notice
Recent Posts
Recent Comments
Link
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
Archives
Today
Total
관리 메뉴

forest_moon

[hackerrank, SQL] Weather Observation Station 14 본문

알고리즘

[hackerrank, SQL] Weather Observation Station 14

rokga 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)로 찾음