Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- dd.driver_uuid, count(t.uuid) as trip_no, sum(t.original_fare_local) as trip_fare, -sum(commission_local) as commission, sum(toll_amount_local) as toll, sum(t.original_fare_local) - sum(toll_amount_local) as commisionable_fare
- FROM dim_driver dd JOIN fact_trip t on dd.driver_uuid = t.driver_uuid and t.status = 'completed'
- WHERE (dd.signup_city_id = 143 or dd.flow_city_id = 143) and t.begintrip_timestamp_local between '2016-8-15 04:00:00' and '2016-8-22 03:59:59'
- GROUP BY 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement