I have 2 tables, I_786 (100k records) and B_786(700k records). The I_786 table all records must be deleted from B_786 table. Here I table is derived from B table by taking the first 100k records of it by using rownum. After that i need to delete the same records which are in I table. I created the query as below,
DELETE FROM B_786
WHERE EXISTS (SELECT *
FROM I_786);
But it is deleting all the data from B_786 table. Here the where condition is not working. How to optimize the where clause here?