Advertisement
araf53

Untitled

Apr 21st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. select *, (zone_requests/requests) zone_prob
  2.  
  3. from
  4.  
  5. (select rider_id, estimated_pickup_zone, count(*) zone_requests
  6. from map600_rides_v2 where estimated_pickup_zone > 0
  7. and estimated_dropoff_zone > 0 group by 1, 2) A
  8.  
  9. inner join
  10.  
  11. (select rider_id, count(*) requests, sum(if(status = 'COMPLETED', 1, 0)) trips
  12. from map600_rides_v2 where estimated_pickup_zone > 0
  13. and estimated_dropoff_zone > 0 group by 1) B
  14. using (rider_id)
  15.  
  16. having zone_requests/requests > 0.20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement