User Id :    Password :      New Member   Forgot Password  
Topic: SQL Query to delete duplicate record
Mansi Gupta
24 Feb 2011 at 01:01 AM
How to delete duplicate record from a table in sql-server?
Re: SQL Query to delete duplicate record
Sumit Gupta
24 Feb 2011 at 01:08 AM

Here is the query but your table should have identity field.

DELETE FROM tblYourTable WHERE Id NOT IN (SELECT MAX(Id) FROM tblYourTable GROUP BY col1,col2,col3)

here Id is Identity field and col1,col2,col3 can be your table column name.

Total Replies: 1
 
Featured Text Ad

Featured Ad