代码语言:javascript复制
select request_at "Day",round(avg(`status`!="completed"),2) "Cancellation Rate"
from trips t
join users u1
on u1.users_id=t.client_id and u1.banned="No"
join users u2
on u2.users_id=t.driver_id and u2.banned="No"
where request_at between "2013-10-01" and "2013-10-03"
group by request_at