分析
- 从OrderItems表返回order_num。select order_num from OrderItems where prod_id='BR01'
- 从Orders表返回cust_id。select cust_id from Orders where order_num in()
- 从Customers表返回cust_email
代码
select cust_email from Customers
where cust_id in
(select cust_id from Orders
where order_num in
(select order_num from OrderItems
where prod_id='BR01'
)
)