Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
199 views
in Technique[技术] by (71.8m points)

MySQL中in查询的问题

image.png
这条sql从数据库中查询出来的user_id是16,17,13的数据格式,为什么不能直接用作其他sql语句的in查询条件?
image.png
这样用只能查询出来一条?请问这是怎么回事


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

因为你 select user_ids from yun_messages where message_id = 3 得到的 结果是 字符串 1,2,3(实际一个 参数); 而 mysql in 的条件是 多个


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...