Weather Observation Station 4

개발자지니!
|2023. 12. 20. 16:36
728x90

문제

https://www.hackerrank.com/challenges/weather-observation-station-4/problem?isFullScreen=true

 

Weather Observation Station 4 | HackerRank

Find the number of duplicate CITY names in STATION.

www.hackerrank.com

 

 

 

 

 

 

풀이(MSSQL)

SELECT COUNT(CITY) - COUNT(DISTINCT CITY) FROM STATION

 

처음에는 문제에 대한 이해가 되지 않아서 생각을 깊게 해야했던 것 같지만 총 CITY 수에서 중복되지 않은 CITY의 개수를 빼면 해결되는 문제였다.

300x250

'SQL > HACKERRANK' 카테고리의 다른 글

Weather Observation Station 6 / 모음으로 시작하는 도시 조회  (0) 2023.12.20
Weather Observation Station 5  (2) 2023.12.20
1st star 달성!!!  (0) 2023.12.19
Weather Observation Station 3  (0) 2023.12.19
Weather Observation Station 1  (0) 2023.12.19