练习:
答案:
我的写法
select
distinct c.customer_id,
c.first_name,
c.last_name
from customers c
join orders o using (customer_id)
where o.order_id in
(select oi.order_id
from order_items oi
where oi.product_id=3)
老师的写法
select
distinct customer_id,
first_name,
last_name
from customers c
join orders o using (customer_id)
join order_items oi using(order_id)
where oi.product_id=3