题解 | 统计快递运输时长

统计快递运输时长

https://www.nowcoder.com/practice/bb4196936f15424dbabe76a501186d91

select
    t.exp_type,
    round(avg(t.time)/3600,1) as time
from
    (select
        e.exp_type,
        timestampdiff(second,a.out_time,a.in_time) as time
    from 
        express_tb e left join exp_action_tb a
    on 
        e.exp_number=a.exp_number) t
group by 
    t.exp_type    
order by 
    round(avg(t.time)/3600,1) asc


全部评论

相关推荐

02-12 01:30
已编辑
四川文理学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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