题解 | 统计快递运输时长

with diff_hour as(
select t1.exp_type,t2.*,((timestampdiff(minute,t2.out_time,t2.in_time))/60) as diff
from express_tb as t1
inner join exp_action_tb as t2
on t1.exp_number = t2.exp_number)

select exp_type,round(avg(diff),1) as time
from diff_hour
group by exp_type
order by time asc;

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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