题解 | #牛客的课程订单分析(七)#
牛客的课程订单分析(七)
http://www.nowcoder.com/practice/d6f4a37f966145da8900ba9edcc4c068
select (case m.i when "no" then m.name else "GroupBuy" end) as c,count(*) from (SELECT h.id,h.is_group_buy i,c.name from client c right join (SELECT *,count(*)over(PARTITION by user_id) n FROM order_info where status = "completed" and product_name in ("C++","Java","Python") and DATEDIFF(date,"2025-10-15")>=1) h on c.id = h.client_id where h.n>=2 order by h.id) m group by c order by c asc