-
Weather Observation Station 4 MySQLHackerRank/SQL 2023. 2. 8. 17:46
문제
https://www.hackerrank.com/challenges/weather-observation-station-4/problem
Weather Observation Station 4 | HackerRank
Find the number of duplicate CITY names in STATION.
www.hackerrank.com
풀이
- 집계함수 COUNT를 이용해 전체 행 수에서 중복을 제거한 행 수를 빼준다.
SELECT COUNT(CITY) - COUNT(DISTINCT(CITY)) FROM STATION
참조
https://junyoung-developer.tistory.com/30
[MySQL] Weather Observation Station 4
▶ SQL > Basic Select > Weather Observation Station 4 Problem Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table. The STATION table is described as follows: > 표에 있는 총 CI
junyoung-developer.tistory.com
'HackerRank > SQL' 카테고리의 다른 글
Binary Tree Nodes MySQL (0) 2023.02.11 Occupations MySQL (0) 2023.02.10 The PADS MySQL (0) 2023.02.10 The Report MySQL (0) 2023.02.09 Weather Observation Station 6 MySQL (0) 2023.02.09