-
Weather Observation Station 20 MySQLHackerRank/SQL 2023. 2. 15. 13:02
문제
https://www.hackerrank.com/challenges/weather-observation-station-20/problem
Weather Observation Station 20 | HackerRank
Query the median of Northern Latitudes in STATION and round to 4 decimal places.
www.hackerrank.com
풀이
- 서브쿼리와 PERCENT_RANK()를 이용한다.
SELECT ROUND(LAT_N, 4) FROM (SELECT LAT_N, PERCENT_RANK() OVER (ORDER BY LAT_N) AS P FROM STATION) AS A WHERE A.P = 0.5
참조
https://transferhwang.tistory.com/562
[MySQL] 데이터에서 중앙값(Median) 찾기
https://www.hackerrank.com/challenges/weather-observation-station-20/problem Weather Observation Station 20 | HackerRank Query the median of Northern Latitudes in STATION and round to 4 decimal places. www.hackerrank.com https://yahwang.github.io/posts/48
transferhwang.tistory.com
'HackerRank > SQL' 카테고리의 다른 글
Population Census MySQL (0) 2023.02.16 Top Earners MySQL (0) 2023.02.13 Binary Tree Nodes MySQL (0) 2023.02.11 Occupations MySQL (0) 2023.02.10 The PADS MySQL (0) 2023.02.10