Introduction: In this article today I am going to explain how to find duplicate records in a table in SQL server
I have a table Student_Detail and having duplicate records.
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
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)
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.