select ename
from emp
where birthdate > any
(select birthdate from customer where birthdate > '31-DEC-1985')
上面的SQL语句可以优化为
select ename
from emp,(select min(birthdate) min_bday from customer where birthdate > '31-DEC-1985') in_line_view
where emp.birthdate > in_line_view.min_bday;
OCP考题:
Q: 8 Click the Exhibit button and examine the data from the ORDERS and
CUSTOMERS tables.
Evaluate this SQL statement:
SELECT cust_id, ord_total
FROM orders
WHERE ord_total > ANY(SELECT ord_total
FROM orders
WHERE cust_id IN (SELECT cust_id
FROM customers
WHERE city LIKE
'New York'));
What is the result when the above query is executed?