solution


  • 0
    H
    select a.Request_at as Day, round(Sum(Case When a.Status= 'completed' Then 0 Else 1 End)/Count(*),2) as `Cancellation Rate` from 
    (select * from Users join Trips  
    on Users.Users_Id = Trips.Client_id 
    where Role = 'client' and Banned = 'No') as a
    where Request_at between '2013-10-01' and '2013-10-03'
    group by Request_at
    

    a little trick for column name Cancellation Rate here: is needed because there is a space between.


Log in to reply
 

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