题解 | 支付间隔平均值


    select CAST((sum(gap) / count(distinct order_id)) AS SIGNED) as gap
    from
    (
        select order_id, ABS(timestampdiff(second, time1, time2)) as gap
        from (
        select ol.order_id, ol.logtime as time1, sl.logtime as time2
            from 
            order_log as ol join
            select_log as sl
            on ol.order_id=sl.order_id
        ) as t
    ) as t1

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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