SHARE
TWEET

Untitled

araf53 Apr 21st, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top