another way


  • 0
    C

    select (f.cancel100/f.total) as cancellationRate, request as day from (select count(e.banned) as cancel, count() as total, e.request
    from (select d.clientid, d.request, c.banned from trips d left join (select distinct a.clientid, b.banned
    from trips a join users b
    on a.clientid=b.usersid
    where status <> 'completed') c
    on c.clientid=d.clientid where banned = 'no' or banned is null) e
    group by e.request) f


Log in to reply
 

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