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 bcp? When is it used?
tell us something about heap tables. : Sql dba
Can I copy :old and :new pseudo-records in/to an oracle stored procedure?
What is normalisation in sql?
What are three advantages to using sql?
what are the features and advantages of object-oriented programming? : Sql dba
What is not equal in sql?
What are tables and fields?
How to pipe multiline string to isql?
What are different types of sql?
Can primary key be changed?
Why function is used in sql?
How do you delete duplicates in sql query using rowid?
How to use sql*plus built-in timers?
How do I create a sql script?