Problem Statement
A description of the problem can be found on Hackerrank.
Solution
In a subselect selects count
of all cities
and unique cities
and then substract these numbers.
I created solution in:
All solutions are also available on my GitHub.
SQL
1 2 3 4 5 |
select num - num_uniq from ( select count(city) as num, count(distinct city) as num_uniq from station ); |