How to find duplicate records in a table in SQL server - Free Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server,WCF,Entity framework snippets and tutorial

How to find duplicate records in a table in SQL server

Introduction: In this article today I am going to explain how to find duplicate records in a table in SQL server

Description:

I have a table Student_Detail and having duplicate records.
  
find duplicate records in a table in SQL server


We can find the duplicate records of table using Group by clause. To find the duplicate records of table use the below given Query:

Select SudentName,Fee,StudentClass,StudentRollNo, count(*) as Duplicate from dbo.Student_Detail group by SudentName,Fee,StudentClass,StudentRollNo having count(*) >1


find duplicate records in a table in SQL server


We can also use the beloe given query to find the duplicate records:

Select SudentName,Fee,StudentClass,StudentRollNo from dbo.Student_Detail group by SudentName,Fee,StudentClass,StudentRollNo having (count(SudentName) >1)

find duplicate records in a table in SQL server

Is this article helpful for you?

If yes post your comment to appreciate my work and fell free to contact me. You can like me on Facebook, Google+, Linkedin and Twitter via hit on Follow us Button and also can get update follow by Email.

What do you think about this article?

If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.

Share this

Share on FacebookTweet on TwitterPlus on Google+


EmoticonEmoticon