Pergunta

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 ;)

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top