OkBublewrap

Weather Observation Station 4 본문

개발/SQL

Weather Observation Station 4

옥뽁뽁 2023. 2. 22. 03:36

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 1 returns , because total number of records - number of unique ci 

SELECT count(city) - count(distinct city)
FROM station

city의 값의 총합 - city의 고유값 총합 = 13

'개발 > SQL' 카테고리의 다른 글

Weather Observation Station 9  (0) 2023.02.22
Weather Observation Station 8  (0) 2023.02.22
Weaher Observation Station 7  (0) 2023.02.22
Weather Observation Station 5  (0) 2023.02.22
Weather Observation Station 3  (0) 2023.02.22