题解 | #确定哪些订单购买了 p#
确定哪些订单购买了 prod_id 为 BR01 的产品(一)
https://www.nowcoder.com/practice/b692b0174c0444fa9452aee2d082fbbb
1、子查询
select cust_id, order_date from Orders where order_num in( select order_num from OrderItems where prod_id = "BR01" ) order by order_date
2、关联查询
select cust_id, order_date from Orders t inner join OrderItems t1 on t.order_num = t1.order_num where prod_id = "BR01" order by order_date