Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select *, (zone_requests/requests) zone_prob
- from
- (select rider_id, estimated_pickup_zone, count(*) zone_requests
- from map600_rides_v2 where estimated_pickup_zone > 0
- and estimated_dropoff_zone > 0 group by 1, 2) A
- inner join
- (select rider_id, count(*) requests, sum(if(status = 'COMPLETED', 1, 0)) trips
- from map600_rides_v2 where estimated_pickup_zone > 0
- and estimated_dropoff_zone > 0 group by 1) B
- using (rider_id)
- having zone_requests/requests > 0.20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement