How to delete duplicate rows from a table?
In this post, we will take a look at the most frequently asked and interviewers' favorite question "How to delete duplicate rows from a table?" Creating Database Table The following scripts can be used to create a sample table that holds the duplicate records. CREATE TABLE EMP_DUP (EMPNO NUMBER(4,0) NOT NULL ENABLE, ENAME VARCHAR2(10), JOB VARCHAR2(9), MGR NUMBER(4,0), HIREDATE DATE, SAL NUMBER(7,2), COMM NUMBER(7,2), DEPTNO NUMBER(2,0), CREATED_AT DATE ); / INSERT INTO EMP_DUP VALUES (7839,'KING','PRESIDENT',null,to_date('17-11-81','DD-MM-RR'),5000,null,10,to_date('25-06-21','DD-MM-RR')); INSERT INTO EMP_DUP VALUES (7698,'BLAKE','MANAGER',7839,to_date('01-05-81','DD-MM-RR'),2850,null,30,to_date('25-06-21','DD-MM-RR')); INSERT INTO EMP_DUP VALUES (7782,'CLARK','MANAGER',7839,to_date('09-06-81','DD-MM-RR'),2450,null,10,to