Studying data
[HackerRank] Aggregation > Weather Observation Station 15 본문
Query the Western Longitude (LONG_W) for the largest Northern Latitude (LAT_N) in STATION that is less than . Round 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 Solution 1]
select round(long_w, 4)
from station
where lat_n = (select max(lat_n) from station where lat_n < 137.2345);
[MySQL Solution 2]
select round(long_w,4)
from station
where lat_n < 137.2345
order by lat_n desc limit 1;
문제 링크:
https://www.hackerrank.com/challenges/weather-observation-station-15/problem?isFullScreen=true
'SQL' 카테고리의 다른 글
[HackerRank] Basic Join > Population Census (0) | 2022.12.31 |
---|---|
[HackerRank] Aggregation > Weather Observation Station 20 (0) | 2022.12.30 |
[HackerRank] Aggregation > Top Earners (0) | 2022.12.29 |
[HackerRank] Advanced Select > New Companies (0) | 2022.12.28 |
[HackerRank] Advanced Select > Binary Tree Nodes (0) | 2022.12.28 |
Comments