I have a table where cityName is a column.
I want to find if there are same cityName exists and if so how many count for each entry.
What is the query ?
that will give you all duplicates and number of them
select count(cityName) as num, cityNamefrom yourTablehaving count(cityName)>1group by cityName
... but HAVING comes after GROUP BY