ahadianNKC

Untitled

Dec 22nd, 2022
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.65 KB | None | 0 0
  1. /**QUERY GET DELIVERY REPORT**/
  2. 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,
  3. a.delivery_type , a.delivery_status , b.driver_name , b.booking_id ,
  4. a.delivery_charge , a.delivery_charge_tax ,
  5. c.promo_name , c.promo_raw_data
  6. FROM kfcdata.`orders_2022-12` a
  7. JOIN kfcdata.`order_deliveries_2022-12` b ON a.order_id = b.order_id
  8. LEFT OUTER JOIN kfcdata.`order_promotions_2022-12` c ON a.order_id = c.order_id
  9. LEFT OUTER JOIN kfcdata.users d ON a.user_id = d.uid
  10. WHERE a.order_type ='HMD'
  11. AND (a.delivery_type IN ('GrabExpressCar','GrabExpressBike','GoSend'))
Advertisement
Add Comment
Please, Sign In to add comment