Introduction:
Here I will explain how to write a query to get duplicate records from table in sql server or Query to get count of duplicate records or rows in SQL Server or query to find duplicate records in SQL server.
Here I will explain how to write a query to get duplicate records from table in sql server or Query to get count of duplicate records or rows in SQL Server or query to find duplicate records in SQL server.
Description:
In
previous post I explained Query to alter table columns and Query to delete duplicate records in SQL
Server.
Now I will explain how to write SQL query to get duplicate records count that means how many times each duplicate record exists in
datatable. In database I have one table that doesn’t contain any primary key
column because of that duplicate records inserted in table that would be like
this
Now I want to know the duplicate records count that
means how many times each duplicate record exists in datatable for that I written
a query like this
SELECT Id,Name, COUNT(*) as DupeCount
FROM EmployeData
GROUP BY Id,Name
HAVING COUNT(*) > 1 Order By Id
|
After run above query we will get each record duplicate
count that would be like this
If
you want to delete duplicate records or rows from datatable check this link Query to delete duplicate records in SQL server
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
5 comments :
You Develop a very good website..
Can u please give example to redirect to gmail accout. I gmail username and gmail password only when they click gmail-Button it should redirect to gmail account. Please show with some example
Thanks in advance
Actually need to specified how to write code for C# checking duplicate record through entering text box
my data contains where an employee is assigned to many projects while most of the employees are assigned only one project. My object is to report to management the names of persons assigned to more than one project. Please help to create suitable query in Access 2007
LOOSERS!!!!!!!
Note: Only a member of this blog may post a comment.