SQL IN Clause 1000 item limit

There’s another workaround for this that isn’t mentioned in any of the other answers (or other answered questions):

Any in statement like x in (1,2,3) can be rewritten as (1,x) in ((1,1), (1,2), (1,3)) and the 1000 element limit will no longer apply. I’ve tested with an index on x and explain plan still reports that Oracle is using an access predicate and range scan.

Leave a Comment