_CODER_
asked on
Select and display duplicates in a table
I need to write a select statement that will show all records that have the same "UserCode" in a table.
I have the below but it's only showing one of each duplicate. I need to list them out so it will show each user...
What would I write to show each duplicate so I can compare them.
SELECT UserCode, FirstName, LastName
FROM Users
WHERE UserCode is not null
GROUP BY UserCode
HAVING (COUNT(UserCode) > 1 )
I have the below but it's only showing one of each duplicate. I need to list them out so it will show each user...
What would I write to show each duplicate so I can compare them.
SELECT UserCode, FirstName, LastName
FROM Users
WHERE UserCode is not null
GROUP BY UserCode
HAVING (COUNT(UserCode) > 1 )
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.