FanFan
FanFan

Reputation: 295

MySQL Count with a condition

Let's say I have a table which contains cities and names. But in a city, the names are duplicate. How can I count the duplicate names which belong to every distinct city?

Upvotes: 0

Views: 40

Answers (1)

SonalPM
SonalPM

Reputation: 1337

select count(name) from Table group by CITY having count(*) > 1 

Upvotes: 1

Related Questions