题解 | #牛客的课程订单分析(三)#
牛客的课程订单分析(七)
http://www.nowcoder.com/practice/d6f4a37f966145da8900ba9edcc4c068
有思路就能写出来,
select if(o.is_group_buy='Yes','GroupBuy',c.name)as source,count(o.client_id) from order_info as o left join client as c on o.client_id=c.id where o.date>'2025-10-15' and o.status='completed' and o.product_name in('C++','Python','Java') and o.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 ) group by c.name order by source