SELECT Request_at as Day,
ROUND(COUNT(IF(Status != 'completed', TRUE, NULL)) / COUNT(*), 2) AS 'Cancellation Rate'
FROM Trips
WHERE (Request_at BETWEEN '2013-10-01' AND '2013-10-03')
AND Client_id NOT IN (SELECT Users_Id FROM Users WHERE Banned = 'Yes')
GROUP BY Request_at;
Runtime: 166 ms, faster than 99.72% of MySQL online submissions for Trips and Users.
Memory Usage: 0B, less than 100.00% of MySQL online submissions for Trips and Users.
https://leetcode.com/problems/trips-and-users/
Runtime: 166 ms, faster than 99.72% of MySQL online submissions for Trips and Users. Memory Usage: 0B, less than 100.00% of MySQL online submissions for Trips and Users.