1

我没有这个例子,但我只是想知道这样的事情在任何情况下是否有效:

SELECT somefield
FROM sometable
WHERE something1 IN (SELECT somefield2 FROM sometable2)
  AND something2 IN (SELECT somefield3 FROM sometable3)
4

2 回答 2

1

一句话—​​—是的。您可以在一个where子句中包含任意数量的条件,无论它们是否具有in条件。

于 2016-04-22T16:39:20.283 回答
0

是的。您的语法需要修复:

SELECT somefield
FROM sometable
WHERE something1 IN (SELECT somefield2 FROM sometable2)                        
AND something2 IN (SELECT somefield3 FROM sometable3)
于 2016-04-22T16:39:40.310 回答