【发布时间】:2019-10-09 21:25:05
【问题描述】:
我想知道您可以在 mysql Query 中使用“IN”子句查询的最大项目数。 例如: select * from student where student.name IN ("a1","a2","a3", ..... "an");
【问题讨论】:
-
你可以参考这里。没有限制。 stackoverflow.com/a/4275704/10342514
我想知道您可以在 mysql Query 中使用“IN”子句查询的最大项目数。 例如: select * from student where student.name IN ("a1","a2","a3", ..... "an");
【问题讨论】:
IN 子句中值的数量由 max_allowed_packet 值定义。
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_allowed_packet
默认值 (>= 8.0.3) 67108864
默认值(
但如果你的 IN 结果可以由查询生成,那么你可以用 INNER JOIN 替换 IN 子句
【讨论】: