题解 | 统计快递运输时长
统计快递运输时长
https://www.nowcoder.com/practice/bb4196936f15424dbabe76a501186d91
SELECT
a.exp_type,
ROUND(AVG(TIMESTAMPDIFF(SECOND,b.out_time,b.in_time) / 3600),1) AS time
FROM express_tb AS a
INNER JOIN exp_action_tb AS b
ON a.exp_number = b.exp_number
GROUP BY a.exp_type
ORDER BY time;

查看10道真题和解析