题解 | #确定哪些订单购买了prod_id为BR01的产品
确定哪些订单购买了 prod_id 为 BR01 的产品(二)
https://www.nowcoder.com/practice/999aa31a9a504c60baa088d90d82e64d
//先用子查询,查询出购买了BR01产品的订单号码
//使用in,去将Orders表中对应的数据进行筛选
select
cust_id,
order_date
from
Orders as b
where
b.order_num in (
select
order_num
from
OrderItems as a
where
a.order_num = b.order_num
and prod_id = 'BR01'
)
order by
order_date asc