262. 行程和用户

262. 行程和用户

 

# Write your MySQL query statement below
select 
    t.Request_at as Day, round(count(if(t.Status != 'completed', status, null))/count(status), 2) 
as 
    'Cancellation Rate' 
from
    Trips t join Users u
on 
    t.Client_id = u.Users_Id 
and
    u.Banned = 'No' 
where 
    t.Request_at >= '2013-10-01'
and 
    t.Request_at <= '2013-10-03'
group by 
    t.Request_at;

 

posted @ 2020-03-24 19:08  Let_Life_Stop  阅读(157)  评论(0编辑  收藏  举报