SQL Query to find duplicate rows

ms sql logoI needed a SQL query that would parse through hundreds of thousands of records and list duplicate content. I found a SQL query that would work and made my own modifications to it so that the query may return the desired results. This is one of those things I will not remember so here is the script.

SELECT emailaddress, firstname, lastname,
FROM customers
GROUP BY emailaddress
HAVING COUNT(emailaddress) > 1


Even though the above script with modifications did as advertised, this is another source I found that provided valuable information regarding the SQL COUNT statement.