My Accepted Answer with Simple Join

  • 0

    Write your MySQL query statement below

    select Request_at as Day
    ,round(sum(case when t.status!='completed' then 1 else 0 end) /count(1),2) as "Cancellation Rate"
    from Trips as t
    inner join Users as u on t.Client_id=u.Users_id
    where u.Banned='No' and 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.