日期:2014-05-16 浏览次数:20442 次
需求:返回所有birthday > 出生于1985年之后的任何客户 的职员名称
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?