You are viewing a single comment's thread. Return to all comments →
COUNT () is the aggregate Funtion that used to count the number of rows in a table.
COUNT(city) will count the number of row If it has city column and has value. If the city name is repeated in any row that also be counted .
COUNT (DISTINCT city) count the number of row in which has the city column but did not count that row in which the city value is repeated.
SELECT count(city) - count(DISTINCT city) FROM STATION;
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 4
You are viewing a single comment's thread. Return to all comments →
COUNT () is the aggregate Funtion that used to count the number of rows in a table.
COUNT(city) will count the number of row If it has city column and has value. If the city name is repeated in any row that also be counted .
COUNT (DISTINCT city) count the number of row in which has the city column but did not count that row in which the city value is repeated.
SELECT count(city) - count(DISTINCT city) FROM STATION;