Fine tune the querry
im trying to loop throught the table and look for duplicate records and delete the duplicate records using the below query
For Mcur In ( select Max(empiid) empiid ,MAx(ROWID) MaxROWID from emp
group by empiid having count(*)>1)
Loop
Delete from emp where empiid=Mcur.empiid and RowId<Mcur.MaxROWID;
End Loop;
Its taking more then 5hrs to complete, can i request your help on fine tunning the query so that it deletes the records within few minitues,
Thanks
sankar