Editorial / Best Answer
Answered by:
Hanif
we have to use the group by with having command to get the duplicate values. this query shall show the result of only the users have duplicate values in the employee table.
Syntex:
Select columnName From Table_name
Group By columnName
Having count (*) > 1
Example:
SELECT UserID FROM employee
GROUP BY userid
HAVING count( * ) > 1
How to find out duplicate records in sql server?
Editorial / Best Answer
Answered by: Hanif
we have to use the group by with having command to get the duplicate values. this query shall show the result of only the users have duplicate values in the employee table.
Syntex:
Select columnName From Table_name
Group By columnName
Having count (*) > 1
Example:
SELECT UserID FROM employee
GROUP BY userid
HAVING count( * ) > 1