Skip to content

Commit aaf818c

Browse files
committed
Time: 989 ms (91.04%), Space: 0B (100%) - LeetHub
1 parent 4b48771 commit aaf818c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* Write your PL/SQL query statement below */
2+
SELECT U.name, NVL(SUM(R.distance), 0) AS travelled_distance
3+
FROM Users U
4+
LEFT JOIN Rides R
5+
ON U.id = R.user_id
6+
GROUP BY U.id, U.name
7+
ORDER BY travelled_distance DESC, U.name

0 commit comments

Comments
 (0)