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.
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.
No comments:
Post a Comment