We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Weather Observation Station 4
Weather Observation Station 4
Sort by
recency
|
1391 Discussions
|
Please Login in order to post a comment
Umm... "SELECT UNIQUE (SELECT COUNT(CITY) FROM STATION) - (SELECT COUNT(DISTINCT CITY) FROM STATION) FROM STATION;"
Let me explain this for MySQL. For this question you actually need three answers so you will have to write SELECT three times. And two of those times are their own queries so you have to write almost the full syntax besides the ending ; while the last is just a calculation you can just write SELECT and the - operator. So this is how you write it.
SELECT (SELECT COUNT(city) FROM STATION) - (SELECT COUNT(DISTINCT CITY) FROM STATION);
SELECT COUNT(CITY) - COUNT(DISTINCT CITY) FROM STATION;
(select sum(city) from station) minus (select sum(distinct city) from station);
SELECT (SELECT COUNT(*) FROM STATION) - (SELECT COUNT(DISTINCT CITY) FROM STATION) AS Difference;