题解 | 牛客的课程订单分析(六)

牛客的课程订单分析(六)

https://www.nowcoder.com/practice/c5736983c322483e9f269dd23bdf2f6f

select id,is_group_buy,client_name from 
(select oi.id,oi.is_group_buy,
case oi.is_group_buy when 'No' then c.name
when 'Yes' then null end client_name,
count(*)over(partition by oi.user_id) ct
from order_info oi left join client c on oi.client_id = c.id 
where oi.date>'2025-10-15' and oi.status='completed' and oi.product_name in ('C++','Python','Java')) e  
where e.ct >1
order by id
此题也可用常规group,不过要注意子句和主句都要加上限制条件

全部评论

相关推荐

零零幺零零幺:至少再做一个项目,然后猛投小厂,不然有点难
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务