Matt
Matt

Reputation: 13

What's is the maximum variables the sql "in" statement can handle

As said above
For instance WHERE In(var 1,var 2,var 3, ..., var 5609,)

Any limits before it slows the machine down ?

Upvotes: 1

Views: 4753

Answers (6)

Rich Schuler
Rich Schuler

Reputation: 41972

I would say that if you have to ask then you're probably doing something wrong. :)

Upvotes: 3

leppie
leppie

Reputation: 117220

MS SQL Server chokes at around 2000, MS SQL Compact has no limits (or I have not reached it yet, more than 2500).

Note: these are limits on parameters for queries.

Upvotes: 0

bkaid
bkaid

Reputation: 52073

I don't believe there is a limit to the number of values in the list of the IN clause in MySQL, unlike the 1000 Oracle limit. I would verify this though by writing some sort of loop to build a really long 'IN' statement if you had a concern. Also, someone else asked this question and there wasn't a known limit.

Upvotes: 2

Sujee
Sujee

Reputation: 5145

In Oracle (Verified only in 10g) it is 1000.

ORA-01795: maximum number of expressions in a list is 1000

Upvotes: 1

Kamran Khan
Kamran Khan

Reputation: 9986

Oracle 9i Maximum number of expressions in a list is 1000;

Upvotes: 1

Evan Trimboli
Evan Trimboli

Reputation: 30082

With "limits", are you referring to a limitation in the the implementation, or something that will slow the query down? If it's the latter, the best answer is test it yourself.

Upvotes: 0

Related Questions