Trips and Users simple solution (98ms)

  • 0

    T.Request_at as Day,
    ROUND((SUM(IF(T.Status != 'completed',1,0))/count(T.Client_Id)),2) as Cancellation Rate
    from Trips T
    inner join
    (select Users_Id from Users where Banned = 'No' AND Role = 'client') X
    on T.Client_Id = X.Users_Id
    where T.Request_at between '2013-10-01' and '2013-10-03'
    group by T.Request_at;

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.