I would like to delete a few records (100 thousand records) from a table containing 10 million records in an Oracle database. When I tried to delete the records using the below query
DELETE from TEST where ID in (1,2,3,4,1000,,, etc)
It looks like there is limitation of 1000 values, hence the below error:
SQL Error: ORA-01795: maximum number of expressions in a list is 1000
Is there any query to delete more than 1000 records in a single statement without using PL/SQL?
I am thinking of something like the following - please suggest the correct query:
DELETE from TEST where ID in (1,2,3,4,1000)
AND
DELETE from TEST where ID in (1001,1002);
Also please advise whether the delete operation will be faster with or without using the primary key.