Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is meant by <> in sql?

1026


What is bind reference and how can it be created?

1067


What is time based sql injection?

1032


How to write a query to show the details of a student from students table whose

1060


What is a common use of group by in sql?

1094


What do you mean by stored procedures?

1068


How many commands are there in sql?

1085


What are the types of variables use in pl sql?

1084


How do I use google cloud in sql?

1143


How to start oracle sql developer?

1074


What is the difference between cluster and non-cluster index?

1155


Can you selectively load only those records that you need? : aql loader

1092


Can unique keys be null?

949


Which join is default?

1012


Is it possible to include an insert statement on the same table to which the trigger is assigned?

1061