select (case when t1.name is null then 'GroupBuy' else t1.name end) source,count(client_id) from client t1 right join ( select *,count(id) over(partition by user_id) as number from order_info where datediff(date,"2025-10-15")>0 and status="completed" and product_name in ("C++","Java","Python") ) t2 on t1.id=t2.client_id where t2.number >1 group by t1.name order by (case when t1.name is null then 'GroupBuy' else t1.name end);
点赞

相关推荐

吴offer选手:学到了,下次面试也放张纸在电脑上,不然老是忘记要说哪几个点
点赞 评论 收藏
分享
牛客网
牛客企业服务