Latest Post

Finding Duplicate Values in a SQL Table

Microsoft-SQL-Server

Microsoft SQL server has made querying large quantities of data easier and easier over the years. One query a lot of people forget or struggle to do is select all duplicate rows.

To do this do the following query:

SELECT value1
FROM table
GROUP by value1
HAVING (COUNT(value1) >1)

That is a very simple and quick way to isolate duplicate values.

Cheers