Find out Duplicate Rows in Oracle
Find out Duplicate Rows in Oracle
Topic Introduction: In this tutorial, we will show how to find out duplicate rows in Oracle.
Method #1
SELECT LAST_NAME, COUNT (LAST_NAME) "Employee Count"FROM employeesGROUP BY LAST_NAMEHAVING COUNT (LAST_NAME) > 1;
Method #2
SELECT LAST_NAME, rnFROM (SELECT LAST_NAME,ROW_NUMBER () OVER (PARTITION BY LAST_NAME ORDER BY ROWID) rnFROM employees)WHERE rn > 1;
No comments