题解 | #牛客的课程订单分析(七)#
牛客的课程订单分析(七)
https://www.nowcoder.com/practice/d6f4a37f966145da8900ba9edcc4c068
select ifnull(cc.name, 'GroupBuy') as source
, count(1) as cnt
from order_info oo2
left join client cc on oo2.client_id = cc.id
where user_id in (select user_id
from order_info oi
inner join client c on oi.client_id = c.id
where date >= '2025-10-15'
and status = 'completed'
and product_name in ('C++', 'Python', 'Java')
group by user_id
having count(1) >= 2
union
select user_id
from order_info
where client_id = 0)
and date >= '2025-10-15'
and status = 'completed'
and product_name in ('C++', 'Python', 'Java')
group by cc.name
order by source;
查看14道真题和解析
