-
Notifications
You must be signed in to change notification settings - Fork 192
Open
Description
In question 2 they asked average time for each runner not for all
Try this code
SELECT r.runner_id, ROUND(AVG(EXTRACT(EPOCH FROM (r.pickup_time - c.order_time))/60),2) AS AVG_TIME FROM
customer_orders_temp c
JOIN runner_orders_temp r ON r.order_id = c.order_id
WHERE distance IS NOT NULL
GROUP BY r.runner_id
ORDER BY r.runner_id
OUTPUT
runner_id avg_time
1 15.68
2 23.72
3 10.47
Metadata
Metadata
Assignees
Labels
No labels