sql-常见面试题汇总
2021/8/1 19:36:18
本文主要是介绍sql-常见面试题汇总,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1.连续7天登陆但未下单的用户
select c.user_id, count(c.cum) as cum_01 from (select a.user_id,a.time01 - row_number() over(partition by a.user_id order_by a.time01 asc) as cum from ( select distinct user_id ,to_char(event_time,'yyyymmdd') as time01 from user_behaviour where event_name='login' ) a left join (select distinct user_id ,to_char(order_time,'yyyymmdd') as time02 from order) b on a.user_id=b.user_id and a.time01=b.time02 where b.time02 is null) c group by c.user_id having count(c.cum) >=7;
这篇关于sql-常见面试题汇总的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-28MQ底层原理资料详解:新手入门教程
- 2024-11-28MQ项目开发资料详解:新手入门教程
- 2024-11-28MQ项目开发资料详解:入门与初级用户指南
- 2024-11-28MQ消息队列资料入门教程
- 2024-11-28MQ消息队列资料:新手入门详解
- 2024-11-28MQ消息中间件资料详解与应用教程
- 2024-11-28MQ消息中间件资料入门教程
- 2024-11-28MQ源码资料详解与入门教程
- 2024-11-28MQ源码资料入门教程
- 2024-11-28RocketMQ底层原理资料详解