새소식

카테고리 없음

[해커랭크] Weather Observation Station 4

  • -
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
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.