sql - how to find difference between no_of_value and no_of_distinct columns values? -


let number of city entries in station, , let number of distinct city names in station; query value of station. in other words, find difference between total number of city entries in table , number of distinct city entries in table.

input format

the station table described follows: enter image description here

where lat_n northern latitude , long_w western longitude.

you use having filtering resul on aggregated function

 select city,  count(*), count(distinct city)   station  group city  having count(*) <> count(distinct city) 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -