题解 | #考试分数(五)#
牛客的课程订单分析(七)
http://www.nowcoder.com/practice/d6f4a37f966145da8900ba9edcc4c068
with a as ( select order_info.*, count(*) over(partition by user_id) cnt , case order_info.is_group_buy when 'NO' then client.name else 'GroupBuy' end source from order_info left join client on order_info.client_id=client.id where status='completed' and product_name in('C++','Python','Java') and date >'2025-10-15' ) SELECT a.source, COUNT(*) FROM a WHERE a.cnt>1 GROUP BY a.source order BY a.source,COUNT(*) DESC;终于写好了。。。holy。。。