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 are the different dcl commands in sql?
Is primary key is clustered index?
What is application trigger?
How do you update a value in sql?
What is left inner join in sql?
What is the need of merge statement?
How do I truncate a sql log file?
What is the difference between local variables and global variables?
i have a column which may contain this kind of value: 123*67_80,12*8889_5,34*8_874 ,12*7_7 (can contain space before a comma, and this string length can be anything) now i want to split this value into two column like: column1: 123*67,12*8889,34*8,12*7 column2: 80,5,874,7 use function for this
What are all types of user defined functions?
what does myisamchk do? : Sql dba
What are the different tcl commands in sql?
What is an implicit commit?
Is trigger a stored procedure?
What are properties of the transaction?