write a query to delete similar records in particular
fields(columns) in different tables
Answer Posted / ramkumar v
CREATE OR REPLACE PROCEDURE DUP AS
DECLARE
TABLENAME_TMP TABLE;
CURSOR C1 IS
SELECT M.TABLE_NAME
FROM USER_TAB_COLS M
WHERE M.COLUMN_NAME LIKE 'EMPNO';
BEGIN
OPEN C1;
LOOP
FETCH C1 INTO TABLENAME_TMP;
WHEN C1%NOTFOUND THEN EXIT;
DELETE FROM TABLENAME_TMP A WHERE ROWID NOT IN
(SELECT MAX(ROWID) FROM TABLENAME_TMP B
WHERE A.EMPNO>=B.EMPNO);
ENDLOOP;
CLOSE C1;
END DUP;
| Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
what is the functionality of the function htmlentities? : Sql dba
How do I run a query in pl sql developer?
What are schema-level triggers?
Is join same as left join?
Why do we use partitions in sql?
Where the sql database files are stored?
How do I run a sql script?
What is string data type in sql?
How to assign sql query results to pl sql variables?
What is keys and its types?
how to delete an existing column in a table? : Sql dba
what is clause? : Sql dba
What is the difference between clustered and non-clustered index in sql?
How is data stored in sql?
what is not null constraint? : Sql dba