Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**QUERY GET DELIVERY REPORT**/
- SELECT a.order_id , a.user_id ,d.name , a.phone_number , a.order_status , a.payment_status, a.payment_method , a.order_source , a.outlet_code,
- a.delivery_type , a.delivery_status , b.driver_name , b.booking_id ,
- a.delivery_charge , a.delivery_charge_tax ,
- c.promo_name , c.promo_raw_data
- FROM kfcdata.`orders_2022-12` a
- JOIN kfcdata.`order_deliveries_2022-12` b ON a.order_id = b.order_id
- LEFT OUTER JOIN kfcdata.`order_promotions_2022-12` c ON a.order_id = c.order_id
- LEFT OUTER JOIN kfcdata.users d ON a.user_id = d.uid
- WHERE a.order_type ='HMD'
- AND (a.delivery_type IN ('GrabExpressCar','GrabExpressBike','GoSend'))
Advertisement
Add Comment
Please, Sign In to add comment