题解 | 查询单日多次下订单的用户信息?
查询单日多次下订单的用户信息?
https://www.nowcoder.com/practice/9958aed1e74a49b795dfe2cb9d54ee12
with a as(
select user_id,
date(order_time) as order_date,
count(*) as order_nums
from order_tb
group by user_id,date(order_time)
having count(*)>1
)
select order_date,
a.user_id,
order_nums,
vip
from a join uservip_tb using(user_id)
order by order_nums desc;