题解 | 查询下订单用户访问次数?

查询下订单用户访问次数?

https://www.nowcoder.com/practice/32bc1e0fce2343ad934b76a025e09fc5

#先找出9月2日的访问者,在从订单表里面找出9月2日下订单的客户
select v.user_id, 
count(*) as total_nums
from visit_tb v 
where date(v.visit_time)='2022-09-02'
and v.user_id in (select distinct order_tb.user_id from order_tb where date(order_time)='2022-09-02')
group by v.user_id
order by total_nums desc;
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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