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

select
    a.日期 order_date,
    user_id,
    a.次数 order_nums,
    vip
from
    (
        select
            ot.user_id,
            date (order_time) 日期,
            vip,
            count(*) 次数
        from
            test.order_tb ot
            join test.uservip_tb ust on ot.user_id = ust.user_id
        group by
            ot.user_id,
            date (order_time),
            vip
    ) a
where
    次数 > 1

全部评论
佬可以试着打#牛客在线求职答疑中心#这个tag,牛可乐AI现在解题还蛮好用的
点赞 回复 分享
发布于 01-20 10:33 北京

相关推荐

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

创作者周榜

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