题解 | 查询单日多次下订单的用户信息?

查询单日多次下订单的用户信息?

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;

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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