Share my solution at 180ms

  • 0
    Select distinct t.Request_at as Day, 
    round(sum(case t.Status when 'completed' then 0 else 1 end)/count(*),2) 
    as Cancellation_Rate from Trips t 
    inner join Users u on t.Client_Id=u.Users_Id and u.Banned='No' 
    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.