我需要一个SQL语句来检索关键字(或任何列)在关联表中的记录,例如:
documentId termId
4 1
4 2
3 3
5 1
Run Code Online (Sandbox Code Playgroud)
这个:
SELECT documentId
FROM table
WHERE termId IN (1,2,3)
Run Code Online (Sandbox Code Playgroud)
...将检索documentid值为termid1 或 2 或 3的任何值.
有这样的东西,但返回documentid值为termid1 和 2 和 3 的值?像IN但有AND.