【发布时间】:2017-05-17 21:32:42
【问题描述】:
我们需要构造一个有很多条件的Mysql查询:
where userId=useIdi1 or userId=userId2 or userId=userId3....
我知道我可以使用 IN 代替,但只是好奇我们可以传递给 MySQL 中 WHERE 子句的参数(参数)的数量是否有任何限制?
【问题讨论】:
标签: mysql where-clause
我们需要构造一个有很多条件的Mysql查询:
where userId=useIdi1 or userId=userId2 or userId=userId3....
我知道我可以使用 IN 代替,但只是好奇我们可以传递给 MySQL 中 WHERE 子句的参数(参数)的数量是否有任何限制?
【问题讨论】:
标签: mysql where-clause
据我所知,条件的数量没有具体限制,但实际上查询长度是有限制的。
【讨论】:
是的,您可以通过参数找到尺寸: max_allowed_packet
【讨论】: