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

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

http://www.nowcoder.com/practice/348afda488554ceb922efd2f3effc427

看了“韭菜&文盲”练习

先取满足科目,下单完成,日期限制;id分组,最小的日期,第二个日期,次数呢?

[重点是第二个日期]substr(group_concat(distinct date order by date separator ","),12,10),

select user_id,min(date),
substr(group_concat(distinct date order by date separator ","),12,10),
count(date) cnt
from order_info
where status="completed"
and product_name in ("C++","Java","Python")
and date>"2025-10-15"
group by user_id
having count(date)>1
order by user_id

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务