Tutorials and code for ASP.NET 2.0,C#,SQL Server,AJAX tutorials,jQuery  
Home    Articles    Contact Us
 

ASP.NET
AJAX
Interview Questions
Sql Server
Technology News
Tips and Tricks
jQuery

 

Find and Delete duplicate records in a table


Many times you can face problem of duplicate records in table.So How would you identify and delete duplicate records in a table?

For that Firstly check if table has duplicate records or not using below query.

SELECT [FirstName] FROM tblTest GROUP BY [FirstName] HAVING COUNT(*) > 1

Then Delete duplicate records.

DELETE FROM tblTest WHERE ID NOT IN (SELECT MAX(ID) FROM tblTest GROUP BY [FirstName])



User Comments:

Comment By amit on 06/24/2010

not getting


Post Your Comment :


Name
Email:
Comment:

Home | Contact Us

© 2008-09 TechnoReader.com. All rights reserved.