Finding Duplicates in a table wit SQL

Sometimes finding rows with some duplicate values in some column(s) may be necessary. Let's see how can we manage this thing.
SELECT [Column_Name], COUNT([Column_Name]) AS Number_of_Occurrences
FROM [Table_Name]
GROUP BY [Column_Name]
HAVING ( COUNT( [Column_Name] ) > 1 )

And the query to get all PKs ( primary keys ) for rows with duplicate [Column_Name]
SELECT [Primary_key_Column]
FROM [Table_Name]
WHERE [Column_Name] IN (
SELECT [Column_Name]
FROM [Table_Name]
GROUP BY [Column_Name]
HAVING ( COUNT([Column_Name]) > 1 ))

Let's see it with an example. Let's say we have a tale called  Students and the column we are working on is students first name.
So the above code will become


SELECT [First_Name], COUNT([First_Name]) AS Number_of_Occurrences
FROM [Students]
GROUP BY [First_Name]
HAVING ( COUNT( [First_Name] ) > 1 )
And the query to get all PKs ( primary keys ) for rows with duplicate [First_Name]:
SELECT [Student_ID]
FROM [Students]
WHERE [First_Name] IN (
SELECT [First_Name]
FROM [Table_Name]
GROUP BY [First_Name]
HAVING ( COUNT([First_Name]) > 1 ))
This is simple right? yes it is. :D