题解 | #牛客的课程订单分析(六)#
牛客的课程订单分析(六)
http://www.nowcoder.com/practice/c5736983c322483e9f269dd23bdf2f6f
select
a.id
,a.is_group_buy
,c.name
from (
select
*
from order_info
where user_id in (
select
user_id
from order_info
where date > '2025-10-15'
and status = 'completed'
and product_name in ('C++','Python','Java')
group by user_id
having count(user_id) >=2
ORDER by user_id
)
and date > '2025-10-15'
and status = 'completed'
and product_name in ('C++','Python','Java')
order by id
) a
left join client c
on a.client_id = c.id
order by a.id