Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Selecione contagem/duplicatas

SELECT City, Count(City) As theCount
FROM (Select City, State From tblCityStateZips Group By City, State) As C
GROUP By City
HAVING COUNT Count(City) > 1

Isso retornaria todas as cidades, com contagem, contidas em mais de um estado.

Greenville 39
Greenwood 2
GreenBriar 3
etc.