select count(distinct(user_id)) from ( select user_id, dt, lead(dt,2,'1970-01-01') over(partition by user_id order by dt) lead2 from tbl )t1 where datediff(lead2,dt)=2 &&where order_num>100; //三天连续老经典题了,字段有问题,你自己调试
1 1

相关推荐

10-12 19:08
666 C++
花开蝶自来_:技能:听动物叫,让雪豹闭嘴
点赞 评论 收藏
分享
牛客网
牛客企业服务