What`s wrong with my code?


  • 0
    T
    select big.Request_at as Day, truncate ((count(big.ccount)/count(big.rcount)),2) as "Cancellation Rate"
    from
    (select Request_at, 
    case 
        when status = "cancelled_by_client" or status = "cancelled_by_driver" THEN status 
        else null 
        end as ccount,
        
    case 
        when status = "completed" or status = "cancelled_by_client" or status = "cancelled_by_driver" THEN status 
        else null 
        end as rcount
    from 
    Trips 
    inner join
    Users 
    on Users.Users_Id = Trips.Client_Id 
    and Users.Banned = 'NO'
    )big
    where big.Request_at between '2013-10-01' and '2013-10-03'
    group by 1;
    

    My Answer is : {"headers": ["Day", "Cancellation Rate"], "values": [["2013-10-01", 0.33], ["2013-10-02", 0.33], ["2013-10-03", 0.66]]}

    and i am getting incorrect answer error....


Log in to reply
 

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