ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 047-066

047-066

原创 Linux操作系统 作者:jbymy2000 时间:2012-03-18 10:12:18 0 删除 编辑
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/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 042-065
下一篇: 047-067
请登录后发表评论 登录
全部评论

注册时间:2012-01-10

  • 博文量
    416
  • 访问量
    273375