Tuesday, July 17, 2012

Delete duplicate records Query

Found this query to delete duplicate records from a table. Very small query, but if table is big then it will take some time. But works

[code]


DELETE FROM [Table1
WHERE  Table1ID NOT IN SELECT MAX( Table1ID)  
FROM [ Table1GROUP BY [Col1] ,[ Col2] ,[ Col3)


[/code]

Enjoy IT!