All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g1401_1500.s1407_top_travellers.script.sql Maven / Gradle / Ivy

There is a newer version: 1.37
Show newest version
# Write your MySQL query statement below
# #Easy #LeetCode_Curated_SQL_70 #Database #SQL_I_Day_9_Control_of_Flow
# #2022_03_28_Time_682_ms_(70.16%)_Space_0B_(100.00%)
SELECT U.NAME , COALESCE(SUM(R.DISTANCE),0) AS travelled_distance
FROM USERS U LEFT JOIN RIDES R ON U.ID=R.USER_ID
GROUP BY 1 ORDER BY 2 DESC , 1 ASC




© 2015 - 2024 Weber Informatics LLC | Privacy Policy