我没有这方面的例子,但我只是想知道这样的事情在任何情况下是否有效:
SELECT somefield
FROM sometable
WHERE something1 IN (SELECT somefield2 FROM sometable2)
AND something2 IN (SELECT somefield3 FROM sometable3)
答案 0 :(得分:1)
总之 - 是的。您可以在where
子句中拥有任意数量的条件,无论它们是否具有in
条件。
答案 1 :(得分:0)
是。您的语法需要修复:
SELECT somefield
FROM sometable
WHERE something1 IN (SELECT somefield2 FROM sometable2)
AND something2 IN (SELECT somefield3 FROM sometable3)