题解 | #牛客的课程订单分析(六)#
题目与 #牛客的课程订单分析(三)#的区别在于增加了一个表格与是否团购,因此在(三)的结果上增加一个左连接表格,并修改一下最终select的内容即可完成题目;
select c.id,c.is_group_buy,client.name as client_name from (select *,count(*)over(partition by user_id ) as c1 from order_info where `date`>='2025-10-15' and `status`='completed' and product_name in('C++','Python','Java'))c left join client on c.client_id = client.id where c.c1>=2 order by c.id