Alternative for a where in with more than 1000 values?
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