Home  >  Article  >  Database  >  SQL 必知必会笔记9使用子查询

SQL 必知必会笔记9使用子查询

WBOY
WBOYOriginal
2016-06-07 17:39:30962browse

子查询(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 ));

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn