Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-07 17:39:30
Original
956 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!