Do you know if there is a limit of the the numbers of elements we can write in a IN expression ? (with SQL Server)

ex :

SELECT *
FROM table
Where toto IN (1,2,3...., Max ?) 

thank you ;)

有帮助吗?

解决方案

The Oracle SQL DB allows for a maximum of 1000 elements for in statements. However, you are not limited to 1000 elements if you use a select statement rather than specifying each element.

SELECT *
FROM table
Where toto IN (SELECT toto FROM other) 

I've used this when I have queries run for long periods of time that my otherwise timeout. This thread may also be helpful for you https://community.oracle.com/thread/235143

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top