MySQL IN 条件限制 [英] MySQL IN condition limit

查看:74
本文介绍了MySQL IN 条件限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我必须在包含大量 ID 的 MySQL 语句中使用 IN 条件.

Hey, I have to use IN condition in my MySQL statement with a large set of ids.

示例

SELECT * FROM users WHERE id IN (1,2,3,4...100000)

IN 语句可以包含的项目是否有限制?

Is there a limit if items the IN statement can have?

推荐答案

不,没有,检查 关于 IN 函数的手册:

IN 列表中的值数量仅受 max_allowed_pa​​cket 值.

The number of values in the IN list is only limited by the max_allowed_packet value.

这篇关于MySQL IN 条件限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆