0
我想选择与标记ID列表匹配的所有帖子。我试过如下:将子查询与元素列表进行比较
SELECT * FROM posts as t WHERE (SELECT tag_id FROM post_tags WHERE post_tags.post_id = t.id) = ALL (8, 1)
这提供了以下错误:
Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '8, 1))'
如果有人知道如何解决这个我会很高兴。
ALL(8,1)?这是什么? LIMIT呢? – deadman 2014-10-03 13:13:33