Share my answer

  • 1
    select  t.`Request_at` as  Day ,
    sum(case when t.Status = 'completed' then 0 else 1 end) / count(1) ) 
    ,2) as  'Cancellation Rate'
    from Trips t 
    where (select Banned from Users u where t.Client_id = u.Users_id) = 'No' 
    and (select Banned from Users u where t.Driver_id = u.Users_id) = 'No' 
    and t.Request_at >= '2013-10-01' and t.Request_at <= '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.