Oracle SQL: How to use more than 1000 items inside an IN statement
- by Mehper C. Palavuzlar
I have an SQL statement where I would like to get data of 1200 ep_codes by making use of IN. When I include more than 1000 ep_codes inside IN statement, Oracle says I'm not allowed to do that. To overcome this, I tried to change the SQL code as follows:
SELECT ...
FROM ...
WHERE ...
AND ep_codes IN (...1000 ep_codes...)
OR ep_codes IN (...200 ep_codes...)
The code was executed succesfully but the results are strange. Is it appropriate to do that using OR between INs or should I execute two separate codes as one with 1000 and the other with 200 ep_codes?