题解 | 查询出每个运输方式在不同城市的平均运输时长以及总运输费用

查询出每个运输方式在不同城市的平均运输时长以及总运输费用

https://www.nowcoder.com/practice/673bf7b17e7c4962bcde889980eec872

select
    destination_city,
    transport_name,
    round(avg(DATEDIFF(delivery_date, order_date)), 2) as average_transport_duration,
    round(sum(total_cost), 2) as total_transport_cost
from
    order_info
    join transport_detail using (transport_id)
    join cost_data using (order_id)
group by
    destination_city,
    transport_name
    order by destination_city

全部评论

相关推荐

04-27 15:01
早稲田大学 Java
牛客72191338...:可能是时间点的问题,四月底机会确实会相对少点,但佬这个学历摆在这,会有机会的
简历中的项目经历要怎么写
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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