66. Which two statements are true regarding multiple-row subqueries? (Choose
two.)
A. They can contain group functions.
B. They always contain a subquery within a subquery.
C. They use the < ALL operator to imply less than the maximum.
D. They can be used to retrieve multiple rows from a single table only.
E. They should not be used with the NOT IN operator in the main query if NULL
is likely to be a part of the result of the subquery.
Answer: AE
SQL> select dest,revenue from test where revenue in (
select 4000 from test union select null from dual);
DEST REVENUE
---------- ----------
wenzhou 4000
SQL> select dest,revenue
from test where revenue not in (
select 4000 from test union select null from dual);
未选定行
SQL> select dest,revenue
from test where revenue not in (select null from dual);
未选定行
可以结论:只要子查询里有空值,在主查询就不能用not in,因为不能返回任何值。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11312660/viewspace-718846/
,如需转载,请注明出处,否则将追究法律责任。