Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a limit on how many arguments I can pass to MySQL where clause?

we need to construct a Mysql query with lots of conditions:

where userId=useIdi1 or userId=userId2 or userId=userId3....

I know I can use IN instead but just curious if there is any limit on how many parameters(arguments) we can pass to WHERE clause in MySQL?

like image 988
user468587 Avatar asked Aug 31 '25 01:08

user468587


1 Answers

As far as I know there is no limit specifically to the number of conditions, but in practice there is a limit to query length.

See: What is maximum query size for mysql?

like image 118
Uueerdo Avatar answered Sep 02 '25 17:09

Uueerdo