leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE |

1407.sql (188B)


1 SELECT U.name, 2 IFNULL(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 7 ORDER BY SUM(R.distance) DESC, 8 U.name ASC