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 sql lookup?
What is where clause in sql?
what is 'mysqld'? : Sql dba
i have some prob lem to tell me about my self in interview first round ...
How many sql commands are there?
What port does sql server use?
What does the base_object_type column shows in the user.triggers data dictionary view?
What are functions in sql?
How can you tell the difference between an index and a view?
What is the difference between a database and a relational database?
What is pl sql variable?
What is sql basics?
What is a .db file?
What is forward declaration in pl sql?
Explain the working of foreign key?