题解 | 查询下订单用户访问次数?
查询下订单用户访问次数?
https://www.nowcoder.com/practice/32bc1e0fce2343ad934b76a025e09fc5
select user_id,
count(*) as visit_nums
from visit_tb
where user_id in
(
select user_id
from order_tb
where substring(order_time,6,5)='09-02'
)
and visit_time like '%09-02%'
and leave_time like '%09-02%'
group by user_id
order by visit_nums desc
;

查看16道真题和解析