Display duplicate rows in a table
How to Display duplicate rows in a table?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shankar MPosted Nov 27, 2012, 6:25 AM
You can get the entire duplicate row details for the columns being compared something like this,
SELECT *
FROM EMP A
WHERE EXISTS (SELECT 1
FROM EMP
WHERE empno = A.empno AND ROWID < A.ROWID)
Thanks,
Shankar
Blocked AccountPosted Nov 27, 2012, 5:59 AM
SELECT UserName,
COUNT(UserName) AS TotalOccurrences
FROM users
GROUP BY UserName
HAVING ( COUNT(UserName) > 1 )