IT/SQL
[해커랭크] Weather Observation Station 3
김보통김보름
2023. 3. 18. 09:39
728x90
반응형
문제링크 : https://www.hackerrank.com/challenges/weather-observation-station-3/problem?isFullScreen=true
❓문제
Query a list of CITY names from STATION for cities that have an even ID number.
Print the results in any order, but exclude duplicates from the answer.
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the
❗답
SELECT DISTINCT CITY
FROM STATION
WHERE MOD(ID, 2) = 0;
🤔풀이
DISTINCT
- 중복제거
- groupby에 비해 성능이 빠름
MOD(m,n) : m을 n으로 나눈 나머지를 반환
728x90