Thursday, January 7, 2016

SQL: Put more than 1000 items inside an IN Clause

some time we need to provide more than 1000 items inside IN clause.  To achieve this, we need to split values across multiple INs using OR

Sample Query:

select * from USR where usr_key in (1,2,3,----1000) OR usr_key in (1001,1002,...,2000)