1. 程式人生 > >【OCP-12c】CUUG 071題庫考試原題及答案解析(13)

【OCP-12c】CUUG 071題庫考試原題及答案解析(13)

ans ocp answer sele col ESS maximum HERE operator

13、(6-7) choose two
Which two statements are true regarding operators used with subqueries? (Choose two.)
A) =ANY and =ALL operators have the same functionality.
E) The NOT IN operator is equivalent to is NULL.
C) The <ANY operator means less than the maximum.
D) The NOT operator can be used with IN, ANY and ALL operators.
E) The IN operator cannot be used in single-row subqueries.
Answer:CD
(解析:051 曾經出現過,但是當時是單選題,答案是 D,這個語法比較少見。
其實就是把 NOT 放到整個表達式之前,下面條件執行的結果都是一樣,考大家的邏輯思維能力:
WHERE NOT col IN (SELECT ...)(也可以是 WHERE col not IN (SELECT ...))
WHERE NOT col = ANY (SELECT ...)(大於、小於都可以)
WHERE NOT col = ALL (SELECT ...)(大於、小於都可以)
SQL> select deptno from emp
2 where not deptno in (select deptno from dept where deptno=10);
DEPTNO

20
30
30
....
或者:
select deptno from emp
where not deptno = all (select deptno from dept where deptno=10);

【OCP-12c】CUUG 071題庫考試原題及答案解析(13)