MySQL in-operator 必须匹配所有值?
我已经建立了自己的论坛。在进行搜索时,我想找到两个(或更多)特定用户参与的任何线程。我想出了这个:
SELECT * FROM table1 INNER JOIN table2
ON table1.threadid=table2.threadid
WHERE table2.threadcontributor IN ('1','52512')
在意识到它实际上意味着'1' OR '52512'
之前。
有什么方法可以让它工作,以便所有 id 都必须匹配吗?
I've made my own forum. When doing a search I want to find any threads where two (or more) specific users have participated. I came up with this:
SELECT * FROM table1 INNER JOIN table2
ON table1.threadid=table2.threadid
WHERE table2.threadcontributor IN ('1','52512')
Before realizing that it actually means '1' OR '52512'
.
Is there any way to make it work so that all id's has to match?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)