【问题标题】:Is there a limit on how many arguments I can pass to MySQL where clause?我可以将多少个参数传递给 MySQL where 子句是否有限制?
【发布时间】:2017-05-17 21:32:42
【问题描述】:

我们需要构造一个有很多条件的Mysql查询:

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

我知道我可以使用 IN 代替,但只是好奇我们可以传递给 MySQL 中 WHERE 子句的参数(参数)的数量是否有任何限制?

【问题讨论】:

    标签: mysql where-clause


    【解决方案1】:

    据我所知,条件的数量没有具体限制,但实际上查询长度是有限制的。

    见:What is maximum query size for mysql?

    【讨论】:

      【解决方案2】:

      是的,您可以通过参数找到尺寸: max_allowed_pa​​cket

      【讨论】:

        猜你喜欢
        • 2012-10-12
        • 1970-01-01
        • 2023-03-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-11-11
        • 1970-01-01
        • 2017-01-25
        相关资源
        最近更新 更多