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
|
1457 Discussions
|
Please Login in order to post a comment
SELECT SUM(COUNT() - 1) FROM STATION GROUP BY CITY HAVING COUNT() > 1;
Best Answer is: SELECT COUNT (CITY) - COUNT(DISTINCT CITY) FROM STATION;
It’s always helpful when database logic is explained in a simple, real-world way. Really appreciate the clarity and the effort that went into this! Betinexchange 247.com
SELECT COUNT(CITY) - COUNT(DISTINCT CITY) FROM STATION
SELECT COUNT(CITY) - COUNT(DISTINCT CITY) FROM STATION AS DIFFERENCE;
Hello here is the code to solve the problem
there are two ways to compute the difference between: 1. total number of CITY entries (including duplicates) 2. number of distinct CITY entries.
Assuming the table is named STATION and the column is CITY First method: 1. SQL to get the difference directly
Second method: 2.If you want to see the two counts separately (total vs distinct) and compute the difference in a single result: