PL/SQL (MOSC)

MOSC Banner

Alternative for a where in with more than 1000 values?

edited Apr 10, 2020 5:01AM in PL/SQL (MOSC) 7 commentsAnswered

I often need to generate log files where I select values from a table.  Sometimes there are thousands of values I need to look for.  Since a IN clause is limited to 1000 values I use the following code:

SELECT column1, column2

  FROM table1

WHERE ( column1 IN ('1','2',...'990')

OR column1 IN ('991','992',...,'1800','1801)

OR column1 IN ('1802','1803',...,'2700'));

What I'm looking for is an alternative that is less cumbersome.

thanks,

Michael

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center