[LeetCode]--262. Trips and Users

来源:互联网 发布:mac显示电池百分比 编辑:程序博客网 时间:2024/05/19 04:53

Let’s see the problem!
这里写图片描述
这里写图片描述
这里写图片描述

Let’s see some concise answer, this is the Portal

Show the code!

# Write your MySQL query statement belowSELECT Request_at as Day,       ROUND(COUNT(IF(Status != 'completed', TRUE, NULL)) / COUNT(*), 2) AS 'Cancellation Rate'FROM TripsWHERE (Request_at BETWEEN '2013-10-01' AND '2013-10-03')      AND Client_id NOT IN (SELECT Users_Id FROM Users WHERE Banned = 'Yes')GROUP BY Request_at;
0 0
原创粉丝点击