11.1 利用子查询进行过滤
子查询从内到外执行,作为子查询的 SELECT 语句只能查询单个列。
select cust_name,cust_contact from customers where cust_id in (select cust_id from orders where order_num in (SELECT order_num FROM OrderItems WHERE prod_id = ‘RGAN01‘))
子查询经常用于where语句的in中搭配使用
标签:customers tom com 语句 nbsp name 技术 blog bsp
子查询从内到外执行,作为子查询的 SELECT 语句只能查询单个列。
select cust_name,cust_contact from customers where cust_id in (select cust_id from orders where order_num in (SELECT order_num FROM OrderItems WHERE prod_id = ‘RGAN01‘))
子查询经常用于where语句的in中搭配使用
标签:customers tom com 语句 nbsp name 技术 blog bsp
原文地址:https://www.cnblogs.com/slowlyslowly/p/8650552.html