Monday, March 6, 2017

How to find duplicate data on the basis of column name in Sql Server

If you have to find the record of duplicate data for example in my case i need to find out how many user are exist with the same user name.


SELECT username, COUNT(*)
FROM  Customers
GROUP BY username
HAVING COUNT(*) > 1

It will show all the record with number of duplicate items.


No comments:

Post a Comment