Rumah >pangkalan data >tutorial mysql > SQL 必知必会笔记9使用子查询
子查询(subquery),即嵌套在其他查询中的查询。 1. 利用子查询进行过滤 SELECT 语句中,子查询总是从内向外处理。示例: 1 SELECT cust_name, cust_contact 2 FROM Customers 3 WHERE cust_id IN ( SELECT cust_id order_num IN ( SELECT order_num 6 FROM
子查询(subquery),即嵌套在其他查询中的查询。
1. 利用子查询进行过滤SELECT 语句中,,子查询总是从内向外处理。示例:
1 SELECT cust_name, cust_contact 2 FROM Customers 3 WHERE cust_id IN (SELECT cust_id order_num IN (SELECT order_num 6 FROM OrderItems ));