카테고리 없음

[해커랭크] Weather Observation Station 4

김보통김보름 2023. 3. 18. 09:39
728x90
반응형

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

 

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:

where LAT_N is the northern latitude and LONG_W is the western longitude.
For example, if there are three records in the table with CITY values 'New York', 'New York', 'Bengalaru', there are 2 different city names: 'New York' and 'Bengalaru'. The query returns , because .

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

 

전체 CITY 개수에서 중복 CITY 개수 제거

 
728x90