Looking for rows with some duplicate values in some column(s) is very common. I'm not saying that's something hard. I was asked about this. Here is the solution.
1: SELECT [Name], COUNT([Name]) as NumOccurrences
2: FROM [People]
3: GROUP BY [Name]
4: HAVING ( COUNT( [Name] ) > 1 )
And the query to get all PKs ( primary keys ) for rows with duplicate [Name]:
1: SELECT [uid]
2: FROM [People]
3: WHERE [Name] IN (
4: SELECT [Name]
5: FROM [People]
6: GROUP BY [Name]
7: HAVING ( COUNT([Name]) > 1 ))
That's all.