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 meant by <> in sql?
What is bind reference and how can it be created?
What is time based sql injection?
How to write a query to show the details of a student from students table whose
What is a common use of group by in sql?
What do you mean by stored procedures?
How many commands are there in sql?
What are the types of variables use in pl sql?
How do I use google cloud in sql?
How to start oracle sql developer?
What is the difference between cluster and non-cluster index?
Can you selectively load only those records that you need? : aql loader
Can unique keys be null?
Which join is default?
Is it possible to include an insert statement on the same table to which the trigger is assigned?