What is this operator..i'ven't seen it before

You define a multiple-row subquery in the WHERE clause of an SQL query with a comparison operator&qu
ot;=" What happens when the main query is executed?
A. the main query executes with the first value returned by the subquery
B. the main query executes with the last value returned by the subquery
C. the main query executes with all the values returned by the subquery
D. the main query fails because the multiple-row subquery cannot be used with the comparison op
erator.
E. You cannot define multiple-row subquery in the WHERE clause of a SQL query
Explanation: The main query fails because the multiple-row sub-query cannot be used with the comparison operator. Only single-row query can use comparison operators, like =, <, >, <=, >, and & lt;>. Incorrect Answers A: The main query fails because the multiple-row sub-query cannot be used with the comparison operator. B: The main query fails because the multiple-row sub-query cannot be used with the comparison operator. C: The main query fails because the multiple-row sub-query cannot be used with the comparison operator. E: You can define a multiple-row sub-query in the WHERE clause of a SQL query, but error will be generated by different reason. OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 150-165 Chapter 4: Subqueries

And ?
Is your question about E answer ?
Indeed, we can write a subquery which return more than one row, for IN operator for example...
But, as response D said, with = operator this doens't work :
SQL> select deptno from dept;
    DEPTNO
        10
        20
        30
        40
SQL> select count(*)
  2  from emp
  3  where deptno in (select deptno from dept);
  COUNT(*)
        14
SQL> select count(*)
  2  from emp
  3  where deptno = (select deptno from dept);
where deptno = (select deptno from dept)
ERROR at line 3:
ORA-01427: single-row subquery returns more than one row
SQL> Is this your doubt ?
Nicolas.

Similar Messages

Maybe you are looking for