본문 바로가기

Language/SQL

[HackerRank][SQL] Weather Observation Station 4 - 컴도리돌이

728x90
 

Weather Observation Station 4 | HackerRank

Find the number of duplicate CITY names in STATION.

www.hackerrank.com


Problem

Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table.

-> station에 있는 모든 city의 수와 중복을 제외한 city의 수의 차이를 구하시오.


Answer

select count(city) - count(distinct(city))
from station