SELECT
FirstName
,COUNT(*)
from Person.Contact
GROUP BY FirstName HAVING COUNT(*) > 1
Using the AdventureWorks database as the source to execute the query we can quickly determine how many times a person has the same first name. This was a simple example but can be applied to many examples.